chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17

- i18next 23->26 + react-i18next 15->17
- prettier 2->3, reformat all files
- replace @fontsource/inter with @fontsource-variable/inter 5, update import path
- domhandler 5->6 (aligns with transitive deps)
- lint-staged 16->17
This commit is contained in:
Lotus Bot
2026-05-21 23:30:50 -04:00
parent b3666fa876
commit 61a1f008d0
363 changed files with 1443 additions and 1419 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
+153 -145
View File
@@ -13,7 +13,7 @@
"@atlaskit/pragmatic-drag-and-drop": "1.8.1",
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "2.1.5",
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
"@fontsource/inter": "4.5.14",
"@fontsource-variable/inter": "5.2.8",
"@giphy/js-fetch-api": "5.8.0",
"@giphy/js-types": "4.3.0",
"@giphy/react-components": "1.6.0",
@@ -30,7 +30,7 @@
"classnames": "2.5.1",
"dateformat": "5.0.3",
"dayjs": "1.11.20",
"domhandler": "5.0.3",
"domhandler": "6.0.1",
"dompurify": "3.4.5",
"emojibase": "15.3.1",
"emojibase-data": "15.3.2",
@@ -39,7 +39,7 @@
"folds": "2.6.2",
"html-dom-parser": "7.1.0",
"html-react-parser": "6.1.2",
"i18next": "23.12.2",
"i18next": "26.2.0",
"i18next-browser-languagedetector": "8.2.1",
"i18next-http-backend": "4.0.0",
"immer": "11.1.8",
@@ -60,7 +60,7 @@
"react-dom": "18.2.0",
"react-error-boundary": "6.1.1",
"react-google-recaptcha": "2.1.0",
"react-i18next": "15.0.0",
"react-i18next": "17.0.8",
"react-range": "1.10.0",
"react-router-dom": "6.30.3",
"sanitize-html": "2.17.4",
@@ -105,8 +105,8 @@
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "9.1.7",
"lint-staged": "16.3.2",
"prettier": "2.8.1",
"lint-staged": "17.0.5",
"prettier": "3.8.3",
"semantic-release": "25.0.3",
"typescript": "4.9.4",
"vite": "6.4.2",
@@ -2495,10 +2495,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@fontsource/inter": {
"version": "4.5.14",
"resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-4.5.14.tgz",
"integrity": "sha512-JDC9AocdPLuGsASkvWw9hS5gtHE7K9dOwL98XLrk5yjYqxy4uVnScG58NUvFMJDVJRl/7c8Wnap6PEs+7Zvj1Q=="
"node_modules/@fontsource-variable/inter": {
"version": "5.2.8",
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.2.8.tgz",
"integrity": "sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@giphy/js-analytics": {
"version": "1.8.1",
@@ -7022,9 +7026,9 @@
}
},
"node_modules/cli-truncate/node_modules/string-width": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz",
"integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==",
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
"integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -7112,13 +7116,6 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/colorette": {
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
"dev": true,
"license": "MIT"
},
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -7900,6 +7897,21 @@
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
}
},
"node_modules/dom-serializer/node_modules/domhandler": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^2.3.0"
},
"engines": {
"node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/domelementtype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
@@ -7912,19 +7924,36 @@
]
},
"node_modules/domhandler": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",
"integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^2.3.0"
"domelementtype": "^3.0.0"
},
"engines": {
"node": ">= 4"
"node": ">=20.19.0"
},
"funding": {
"type": "github",
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/domhandler/node_modules/domelementtype": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz",
"integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"license": "BSD-2-Clause",
"engines": {
"node": ">=20.19.0"
}
},
"node_modules/dompurify": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.5.tgz",
@@ -7947,6 +7976,21 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
"node_modules/domutils/node_modules/domhandler": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^2.3.0"
},
"engines": {
"node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/dot-prop": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
@@ -10232,22 +10276,6 @@
"node": ">=20.19.0"
}
},
"node_modules/html-dom-parser/node_modules/domhandler": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",
"integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^3.0.0"
},
"engines": {
"node": ">=20.19.0"
},
"funding": {
"type": "github",
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/html-dom-parser/node_modules/domutils": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.2.tgz",
@@ -10339,37 +10367,6 @@
}
}
},
"node_modules/html-react-parser/node_modules/domelementtype": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz",
"integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"license": "BSD-2-Clause",
"engines": {
"node": ">=20.19.0"
}
},
"node_modules/html-react-parser/node_modules/domhandler": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",
"integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^3.0.0"
},
"engines": {
"node": ">=20.19.0"
},
"funding": {
"type": "github",
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/htmlparser2": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz",
@@ -10389,6 +10386,21 @@
"entities": "^7.0.1"
}
},
"node_modules/htmlparser2/node_modules/domhandler": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^2.3.0"
},
"engines": {
"node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/htmlparser2/node_modules/entities": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
@@ -10465,25 +10477,31 @@
}
},
"node_modules/i18next": {
"version": "23.12.2",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-23.12.2.tgz",
"integrity": "sha512-XIeh5V+bi8SJSWGL3jqbTEBW5oD6rbP5L+E7dVQh1MNTxxYef0x15rhJVcRb7oiuq4jLtgy2SD8eFlf6P2cmqg==",
"version": "26.2.0",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-26.2.0.tgz",
"integrity": "sha512-zwBHldHdTmwN7r6UNc7lC6GWNN+YYg3DrRSeHR5PRRBf5QnJZcYHrQc0uaU26qZeYxR7iFZD+Y315dPnKP47wA==",
"funding": [
{
"type": "individual",
"url": "https://locize.com"
},
{
"type": "individual",
"url": "https://locize.com/i18next.html"
"url": "https://www.locize.com/i18next"
},
{
"type": "individual",
"url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
},
{
"type": "individual",
"url": "https://www.locize.com"
}
],
"dependencies": {
"@babel/runtime": "^7.23.2"
"license": "MIT",
"peerDependencies": {
"typescript": "^5 || ^6"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/i18next-browser-languagedetector": {
@@ -11923,37 +11941,28 @@
"license": "MIT"
},
"node_modules/lint-staged": {
"version": "16.3.2",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.3.2.tgz",
"integrity": "sha512-xKqhC2AeXLwiAHXguxBjuChoTTWFC6Pees0SHPwOpwlvI3BH7ZADFPddAdN3pgo3aiKgPUx/bxE78JfUnxQnlg==",
"version": "17.0.5",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.0.5.tgz",
"integrity": "sha512-d12yC+/e8RhBjZtaxZn71FyrgU/P5e+uAPifhCLwdosQZP/zamSdKRWDC30ocVIbzDKiFG1McHc/LUgB92GIPw==",
"dev": true,
"license": "MIT",
"dependencies": {
"commander": "^14.0.3",
"listr2": "^9.0.5",
"micromatch": "^4.0.8",
"listr2": "^10.2.1",
"picomatch": "^4.0.4",
"string-argv": "^0.3.2",
"tinyexec": "^1.0.2",
"yaml": "^2.8.2"
"tinyexec": "^1.1.2"
},
"bin": {
"lint-staged": "bin/lint-staged.js"
},
"engines": {
"node": ">=20.17"
"node": ">=22.22.1"
},
"funding": {
"url": "https://opencollective.com/lint-staged"
}
},
"node_modules/lint-staged/node_modules/commander": {
"version": "14.0.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
"integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=20"
},
"optionalDependencies": {
"yaml": "^2.8.4"
}
},
"node_modules/lint-staged/node_modules/yaml": {
@@ -11962,6 +11971,7 @@
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
"dev": true,
"license": "ISC",
"optional": true,
"bin": {
"yaml": "bin.mjs"
},
@@ -11973,21 +11983,20 @@
}
},
"node_modules/listr2": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz",
"integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==",
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/listr2/-/listr2-10.2.1.tgz",
"integrity": "sha512-7I5knELsJKTUjXG+A6BkKAiGkW1i25fNa/xlUl9hFtk15WbE9jndA89xu5FzQKrY5llajE1hfZZFMILXkDHk/Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"cli-truncate": "^5.0.0",
"colorette": "^2.0.20",
"eventemitter3": "^5.0.1",
"cli-truncate": "^5.2.0",
"eventemitter3": "^5.0.4",
"log-update": "^6.1.0",
"rfdc": "^1.4.1",
"wrap-ansi": "^9.0.0"
"wrap-ansi": "^10.0.0"
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.13.0"
}
},
"node_modules/listr2/node_modules/ansi-regex": {
@@ -12016,26 +12025,18 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/listr2/node_modules/emoji-regex": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
"dev": true,
"license": "MIT"
},
"node_modules/listr2/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
"integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^10.3.0",
"get-east-asian-width": "^1.0.0",
"strip-ansi": "^7.1.0"
"get-east-asian-width": "^1.5.0",
"strip-ansi": "^7.1.2"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -12058,18 +12059,18 @@
}
},
"node_modules/listr2/node_modules/wrap-ansi": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-10.0.0.tgz",
"integrity": "sha512-SGcvg80f0wUy2/fXES19feHMz8E0JoXv2uNgHOu4Dgi2OrCy1lqwFYEJz1BLbDI0exjPMe/ZdzZ/YpGECBG/aQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.2.1",
"string-width": "^7.0.0",
"strip-ansi": "^7.1.0"
"ansi-styles": "^6.2.3",
"string-width": "^8.2.0",
"strip-ansi": "^7.1.2"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
@@ -15754,15 +15755,16 @@
}
},
"node_modules/prettier": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz",
"integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==",
"version": "3.8.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin-prettier.js"
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=10.13.0"
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
@@ -16026,16 +16028,19 @@
}
},
"node_modules/react-i18next": {
"version": "15.0.0",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.0.tgz",
"integrity": "sha512-2O3IgF4zivg57Q6p6i+ChDgJ371IDcEWbuWC6gvoh5NbkDMs0Q+O7RPr4v61+Se32E0V+LmtwePAeqWZW0bi6g==",
"version": "17.0.8",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.8.tgz",
"integrity": "sha512-0ooKbGLU8JXhe1zwpQUWIeXSgLPOfwJmgheWRIUpcoA0CpyabpGhayjdG+/eA5esC1AQ8h2jWpXjJfzQzeDOCw==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.24.8",
"html-parse-stringify": "^3.0.1"
"@babel/runtime": "^7.29.2",
"html-parse-stringify": "^3.0.1",
"use-sync-external-store": "^1.6.0"
},
"peerDependencies": {
"i18next": ">= 23.2.3",
"react": ">= 16.8.0"
"i18next": ">= 26.2.0",
"react": ">= 16.8.0",
"typescript": "^5 || ^6"
},
"peerDependenciesMeta": {
"react-dom": {
@@ -16043,6 +16048,9 @@
},
"react-native": {
"optional": true
},
"typescript": {
"optional": true
}
}
},
@@ -18137,9 +18145,9 @@
"license": "MIT"
},
"node_modules/tinyexec": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.4.tgz",
"integrity": "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.2.tgz",
"integrity": "sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA==",
"dev": true,
"license": "MIT",
"engines": {
+6 -6
View File
@@ -66,7 +66,7 @@
"@atlaskit/pragmatic-drag-and-drop": "1.8.1",
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "2.1.5",
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
"@fontsource/inter": "4.5.14",
"@fontsource-variable/inter": "5.2.8",
"@giphy/js-fetch-api": "5.8.0",
"@giphy/js-types": "4.3.0",
"@giphy/react-components": "1.6.0",
@@ -83,7 +83,7 @@
"classnames": "2.5.1",
"dateformat": "5.0.3",
"dayjs": "1.11.20",
"domhandler": "5.0.3",
"domhandler": "6.0.1",
"dompurify": "3.4.5",
"emojibase": "15.3.1",
"emojibase-data": "15.3.2",
@@ -92,7 +92,7 @@
"folds": "2.6.2",
"html-dom-parser": "7.1.0",
"html-react-parser": "6.1.2",
"i18next": "23.12.2",
"i18next": "26.2.0",
"i18next-browser-languagedetector": "8.2.1",
"i18next-http-backend": "4.0.0",
"immer": "11.1.8",
@@ -113,7 +113,7 @@
"react-dom": "18.2.0",
"react-error-boundary": "6.1.1",
"react-google-recaptcha": "2.1.0",
"react-i18next": "15.0.0",
"react-i18next": "17.0.8",
"react-range": "1.10.0",
"react-router-dom": "6.30.3",
"sanitize-html": "2.17.4",
@@ -158,8 +158,8 @@
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "9.1.7",
"lint-staged": "16.3.2",
"prettier": "2.8.1",
"lint-staged": "17.0.5",
"prettier": "3.8.3",
"semantic-release": "25.0.3",
"typescript": "4.9.4",
"vite": "6.4.2",
+2 -2
View File
@@ -54,7 +54,7 @@ function AccountDataEdit({
const { handleKeyDown, operations, getTarget } = useTextAreaCodeEditor(
textAreaRef,
EDITOR_INTENT_SPACE_COUNT
EDITOR_INTENT_SPACE_COUNT,
);
const [submitState, submit] = useAsyncCallback<void, MatrixError, [string, object]>(submitChange);
@@ -278,7 +278,7 @@ export function AccountDataEditor({
const contentJSONStr = useMemo(
() => JSON.stringify(data.content, null, EDITOR_INTENT_SPACE_COUNT),
[data.content]
[data.content],
);
return (
+1 -1
View File
@@ -45,7 +45,7 @@ export function AuthFlowsLoader({ fallback, error, children }: AuthFlowsLoaderPr
};
return authFlows;
}, [mx])
}, [mx]),
);
useEffect(() => {
+5 -5
View File
@@ -24,7 +24,7 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
caseSensitive: true,
end: false,
},
location.pathname
location.pathname,
)
) {
navigate(getHomePath());
@@ -37,7 +37,7 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
caseSensitive: true,
end: false,
},
location.pathname
location.pathname,
)
) {
navigate(getDirectPath());
@@ -49,7 +49,7 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
caseSensitive: true,
end: false,
},
location.pathname
location.pathname,
);
const encodedSpaceIdOrAlias = spaceMatch?.params.spaceIdOrAlias;
const decodedSpaceIdOrAlias =
@@ -66,7 +66,7 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
caseSensitive: true,
end: false,
},
location.pathname
location.pathname,
)
) {
navigate(getExplorePath());
@@ -79,7 +79,7 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
caseSensitive: true,
end: false,
},
location.pathname
location.pathname,
)
) {
navigate(getInboxPath());
+1 -1
View File
@@ -157,7 +157,7 @@ export function BackupRestoreTile({ crypto }: BackupRestoreTileProps) {
setRestoreProgress(progress);
},
});
}, [crypto, setRestoreProgress])
}, [crypto, setRestoreProgress]),
);
const handleRestore = () => {
+12 -12
View File
@@ -104,7 +104,7 @@ function IncomingCall({ dm, info, onIgnore, onAnswer, onReject }: IncomingCallPr
const roomName = useRoomName(room);
const roomAvatar = useRoomAvatar(room, dm);
const avatarUrl = roomAvatar
? mxcUrlToHttp(mx, roomAvatar, useAuthentication, 96, 96, 'crop') ?? undefined
? (mxcUrlToHttp(mx, roomAvatar, useAuthentication, 96, 96, 'crop') ?? undefined)
: undefined;
const session = useCallSession(room);
@@ -115,7 +115,7 @@ function IncomingCall({ dm, info, onIgnore, onAnswer, onReject }: IncomingCallPr
if (members.length === 0) {
onIgnore();
}
}, [room, session, onIgnore])
}, [room, session, onIgnore]),
);
const playSound = useCallback(() => {
@@ -312,7 +312,7 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps)
const hasCallPermission = permissions.stateEvent(
StateEvent.GroupCallMemberPrefix,
mx.getSafeUserId()
mx.getSafeUserId(),
);
if (!hasCallPermission) return;
@@ -331,7 +331,7 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps)
setCallInfo(info);
},
[mx]
[mx],
);
useEffect(() => {
@@ -355,7 +355,7 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps)
});
setCallInfo(undefined);
},
[mx]
[mx],
);
const handleAnswer = useCallback(
@@ -364,7 +364,7 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps)
setCallInfo(undefined);
navigateRoom(room.roomId);
},
[startCall, navigateRoom]
[startCall, navigateRoom],
);
if (callInfo && callEmbed?.roomId === callInfo.room.roomId) {
@@ -390,7 +390,7 @@ function CallUtils({ embed }: { embed: CallEmbed }) {
embed,
useCallback(() => {
setCallEmbed(undefined);
}, [setCallEmbed])
}, [setCallEmbed]),
);
return null;
@@ -427,7 +427,7 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) {
() => () => {
activeDragCleanupRef.current?.();
},
[]
[],
);
// Track previous pipMode to only reset position when first entering pip (not on callVisible changes)
@@ -510,11 +510,11 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) {
if (pipDragRef.current.dragged) {
el.style.left = `${Math.max(
0,
Math.min(window.innerWidth - el.offsetWidth, pipDragRef.current.origLeft + dx)
Math.min(window.innerWidth - el.offsetWidth, pipDragRef.current.origLeft + dx),
)}px`;
el.style.top = `${Math.max(
0,
Math.min(window.innerHeight - el.offsetHeight, pipDragRef.current.origTop + dy)
Math.min(window.innerHeight - el.offsetHeight, pipDragRef.current.origTop + dy),
)}px`;
el.style.right = 'auto';
el.style.bottom = 'auto';
@@ -563,11 +563,11 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) {
if (pipDragRef.current.dragged) {
el.style.left = `${Math.max(
0,
Math.min(window.innerWidth - el.offsetWidth, pipDragRef.current.origLeft + dx)
Math.min(window.innerWidth - el.offsetWidth, pipDragRef.current.origLeft + dx),
)}px`;
el.style.top = `${Math.max(
0,
Math.min(window.innerHeight - el.offsetHeight, pipDragRef.current.origTop + dy)
Math.min(window.innerHeight - el.offsetHeight, pipDragRef.current.origTop + dy),
)}px`;
el.style.right = 'auto';
el.style.bottom = 'auto';
+2 -2
View File
@@ -7,7 +7,7 @@ type ConfirmPasswordMatchProps = {
match: boolean,
doMatch: () => void,
passRef: RefObject<HTMLInputElement>,
confPassRef: RefObject<HTMLInputElement>
confPassRef: RefObject<HTMLInputElement>,
) => ReactNode;
};
export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPasswordMatchProps) {
@@ -28,7 +28,7 @@ export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPassword
{
wait: 500,
immediate: false,
}
},
);
return children(match, doMatch, passRef, confPassRef);
@@ -27,7 +27,7 @@ import { useAlive } from '../hooks/useAlive';
import { UseStateProvider } from './UseStateProvider';
type UIACallback<T> = (
authDict: AuthDict | null
authDict: AuthDict | null,
) => Promise<[IAuthData, undefined] | [undefined, T]>;
type PerformAction<T> = (authDict: AuthDict | null) => Promise<T>;
@@ -42,7 +42,7 @@ function makeUIAAction<T>(
authData: IAuthData,
performAction: PerformAction<T>,
resolve: (data: T) => void,
reject: (error?: any) => void
reject: (error?: any) => void,
): UIAAction<T> {
const action: UIAAction<T> = {
authData,
@@ -91,7 +91,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
setNextAuthData(authData);
}
},
[uiaAction, alive]
[uiaAction, alive],
);
const resetUIA = useCallback(() => {
@@ -118,7 +118,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
(err) => {
resetUIA();
reject(err);
}
},
);
if (alive()) {
setUIAAction(action);
@@ -130,7 +130,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
reject(error);
});
}),
[alive, resetUIA]
[alive, resetUIA],
);
const [setupState, setup] = useAsyncCallback<void, Error, [string | undefined]>(
@@ -159,8 +159,8 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
onComplete(recoveryKeyData.encodedPrivateKey);
},
[mx, onComplete, authUploadDeviceSigningKeys]
)
[mx, onComplete, authUploadDeviceSigningKeys],
),
);
const loading = setupState.status === AsyncStatus.Loading;
@@ -316,7 +316,7 @@ export const DeviceVerificationSetup = forwardRef<HTMLDivElement, DeviceVerifica
</Box>
</Dialog>
);
}
},
);
type DeviceVerificationResetProps = {
onCancel: () => void;
@@ -375,5 +375,5 @@ export const DeviceVerificationReset = forwardRef<HTMLDivElement, DeviceVerifica
)}
</Dialog>
);
}
},
);
+1 -1
View File
@@ -27,7 +27,7 @@ function GifPickerInner({ onSelect, requestClose, lotusTerminal }: GifPickerInne
onSelect(url, width, height);
requestClose();
},
[onSelect, requestClose]
[onSelect, requestClose],
);
return (
+1 -1
View File
@@ -41,5 +41,5 @@ export const ImageOverlay = as<'div', ImageOverlayProps>(
</FocusTrap>
</OverlayCenter>
</Overlay>
)
),
);
+3 -3
View File
@@ -33,7 +33,7 @@ export const useJoinRuleIcons = (roomType?: string): JoinRuleIcons =>
[JoinRule.Public]: getRoomIconSrc(Icons, roomType, JoinRule.Public),
[JoinRule.Private]: getRoomIconSrc(Icons, roomType, JoinRule.Private),
}),
[roomType]
[roomType],
);
type JoinRuleLabels = Record<ExtendedJoinRules, string>;
@@ -47,7 +47,7 @@ export const useRoomJoinRuleLabel = (): JoinRuleLabels =>
[JoinRule.Public]: 'Public',
[JoinRule.Private]: 'Invite Only',
}),
[]
[],
);
type JoinRulesSwitcherProps<T extends ExtendedJoinRules[]> = {
@@ -79,7 +79,7 @@ export function JoinRulesSwitcher<T extends ExtendedJoinRules[]>({
setCords(undefined);
onChange(selectedRule);
},
[onChange]
[onChange],
);
return (
+3 -3
View File
@@ -21,13 +21,13 @@ export const LogoutDialog = forwardRef<HTMLDivElement, LogoutDialogProps>(
const verificationStatus = useDeviceVerificationStatus(
mx.getCrypto(),
mx.getSafeUserId(),
mx.getDeviceId() ?? undefined
mx.getDeviceId() ?? undefined,
);
const [logoutState, logout] = useAsyncCallback<void, Error, []>(
useCallback(async () => {
await logoutClient(mx);
}, [mx])
}, [mx]),
);
const ongoingLogout = logoutState.status === AsyncStatus.Loading;
@@ -87,5 +87,5 @@ export const LogoutDialog = forwardRef<HTMLDivElement, LogoutDialogProps>(
</Box>
</Dialog>
);
}
},
);
+3 -3
View File
@@ -126,7 +126,7 @@ export function ManualVerificationTile({
const [method, setMethod] = useState(
hasPassphrase
? ManualVerificationMethod.RecoveryPassphrase
: ManualVerificationMethod.RecoveryKey
: ManualVerificationMethod.RecoveryKey,
);
const verifyAndRestoreBackup = useCallback(
@@ -143,11 +143,11 @@ export function ManualVerificationTile({
await crypto.loadSessionBackupPrivateKeyFromSecretStorage();
},
[mx, secretStorageKeyId]
[mx, secretStorageKeyId],
);
const [verifyState, handleDecodedRecoveryKey] = useAsyncCallback<void, Error, [Uint8Array]>(
verifyAndRestoreBackup
verifyAndRestoreBackup,
);
const verifying = verifyState.status === AsyncStatus.Loading;
+2 -2
View File
@@ -43,7 +43,7 @@ export const PdfViewer = as<'div', PdfViewerProps>(
const [pdfJSState, loadPdfJS] = usePdfJSLoader();
const [docState, loadPdfDocument] = usePdfDocumentLoader(
pdfJSState.status === AsyncStatus.Success ? pdfJSState.data : undefined,
src
src,
);
const isLoading =
pdfJSState.status === AsyncStatus.Loading || docState.status === AsyncStatus.Loading;
@@ -257,5 +257,5 @@ export const PdfViewer = as<'div', PdfViewerProps>(
)}
</Box>
);
}
},
);
@@ -17,7 +17,7 @@ const useRoomNotificationModes = (): RoomNotificationMode[] =>
RoomNotificationMode.SpecialMessages,
RoomNotificationMode.Mute,
],
[]
[],
);
const useRoomNotificationModeStr = (): Record<RoomNotificationMode, string> =>
@@ -28,7 +28,7 @@ const useRoomNotificationModeStr = (): Record<RoomNotificationMode, string> =>
[RoomNotificationMode.SpecialMessages]: 'Mention & Keywords',
[RoomNotificationMode.Mute]: 'Mute',
}),
[]
[],
);
type NotificationModeSwitcherProps = {
@@ -37,7 +37,7 @@ type NotificationModeSwitcherProps = {
children: (
handleOpen: MouseEventHandler<HTMLButtonElement>,
opened: boolean,
changing: boolean
changing: boolean,
) => ReactNode;
};
export function RoomNotificationModeSwitcher({
+5 -5
View File
@@ -36,7 +36,7 @@ export function SecretStorageRecoveryPassphrase({
passphrase,
salt,
iterations,
bits
bits,
);
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any);
@@ -47,8 +47,8 @@ export function SecretStorageRecoveryPassphrase({
return decodedRecoveryKey;
},
[mx, keyContent]
)
[mx, keyContent],
),
);
const drivingKey = driveKeyState.status === AsyncStatus.Loading;
@@ -140,8 +140,8 @@ export function SecretStorageRecoveryKey({
return decodedRecoveryKey;
},
[mx, keyContent]
)
[mx, keyContent],
),
);
const drivingKey = driveKeyState.status === AsyncStatus.Loading;
+1 -1
View File
@@ -42,7 +42,7 @@ export function ServerConfigsLoader({ children }: ServerConfigsLoaderProps) {
mediaConfig,
authMetadata: validatedAuthMetadata,
};
}, [mx])
}, [mx]),
);
const configs: ServerConfigs =
@@ -21,7 +21,7 @@ export function SpaceChildDirectsProvider({
const childDirects = useSpaceChildren(
allRoomsAtom,
spaceId,
useChildDirectScopeFactory(mx, mDirects, roomToParents)
useChildDirectScopeFactory(mx, mDirects, roomToParents),
);
return children(childDirects);
@@ -21,7 +21,7 @@ export function SpaceChildRoomsProvider({
const childRooms = useSpaceChildren(
allRoomsAtom,
spaceId,
useChildRoomScopeFactory(mx, mDirects, roomToParents)
useChildRoomScopeFactory(mx, mDirects, roomToParents),
);
return children(childRooms);
+2 -2
View File
@@ -15,7 +15,7 @@ export function SpecVersionsLoader({
children,
}: SpecVersionsLoaderProps) {
const [state, load] = useAsyncCallback(
useCallback(() => specVersions(fetch, baseUrl), [baseUrl])
useCallback(() => specVersions(fetch, baseUrl), [baseUrl]),
);
const [ignoreError, setIgnoreError] = useState(false);
@@ -38,6 +38,6 @@ export function SpecVersionsLoader({
? state.data
: {
versions: [],
}
},
);
}
@@ -35,7 +35,7 @@ import { highlightText, makeHighlightRegex } from '../../plugins/react-custom-ht
export const useAdditionalCreators = (defaultCreators?: string[]) => {
const mx = useMatrixClient();
const [additionalCreators, setAdditionalCreators] = useState<string[]>(
() => defaultCreators?.filter((id) => id !== mx.getSafeUserId()) ?? []
() => defaultCreators?.filter((id) => id !== mx.getSafeUserId()) ?? [],
);
const addAdditionalCreator = (userId: string) => {
@@ -90,12 +90,12 @@ export function AdditionalCreatorInput({
const [validUserId, setValidUserId] = useState<string>();
const filteredUsers = useMemo(
() => directUsers.filter((userId) => !additionalCreators.includes(userId)),
[directUsers, additionalCreators]
[directUsers, additionalCreators],
);
const [result, search, resetSearch] = useAsyncSearch(
filteredUsers,
getUserIdString,
SEARCH_OPTIONS
SEARCH_OPTIONS,
);
const queryHighlighRegex = result?.query ? makeHighlightRegex([result.query]) : undefined;
@@ -42,9 +42,9 @@ export function CreateRoomAliasInput({ disabled }: { disabled?: boolean }) {
throw e;
}
},
[mx]
[mx],
),
setAliasAvail
setAliasAvail,
);
const aliasAvailable: boolean | undefined =
aliasAvail.status === AsyncStatus.Success ? aliasAvail.data : undefined;
+4 -4
View File
@@ -15,7 +15,7 @@ import { CreateRoomAccess } from './types';
export const createRoomCreationContent = (
type: RoomType | undefined,
allowFederation: boolean,
additionalCreators: string[] | undefined
additionalCreators: string[] | undefined,
): object => {
const content: Record<string, any> = {};
if (typeof type === 'string') {
@@ -34,7 +34,7 @@ export const createRoomCreationContent = (
export const createRoomJoinRulesState = (
access: CreateRoomAccess,
parent: Room | undefined,
knock: boolean
knock: boolean,
) => {
let content: RoomJoinRulesEventContent = {
join_rule: knock ? JoinRule.Knock : JoinRule.Invite,
@@ -136,7 +136,7 @@ export const createRoom = async (mx: MatrixClient, data: CreateRoomData): Promis
creation_content: createRoomCreationContent(
data.type,
data.allowFederation,
data.additionalCreators
data.additionalCreators,
),
power_level_content_override:
data.type === RoomType.Call ? createVoiceRoomPowerLevelsOverride() : undefined,
@@ -158,7 +158,7 @@ export const createRoom = async (mx: MatrixClient, data: CreateRoomData): Promis
suggested: false,
via: [getMxIdServer(mx.getUserId() ?? '') ?? ''],
},
result.room_id
result.room_id,
);
}
@@ -11,5 +11,5 @@ export const CutoutCard = as<'div', { variant?: TContainerColor }>(
{...props}
ref={ref}
/>
)
),
);
+6 -6
View File
@@ -36,7 +36,7 @@ const withInline = (editor: Editor): Editor => {
editor.isInline = (element) =>
[BlockType.Mention, BlockType.Emoticon, BlockType.Link, BlockType.Command].includes(
element.type
element.type,
) || isInline(element);
return editor;
@@ -88,11 +88,11 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
onChange,
onPaste,
},
ref
ref,
) => {
const renderElement = useCallback(
(props: RenderElementProps) => <RenderElement {...props} />,
[]
[],
);
const renderLeaf = useCallback((props: RenderLeafProps) => <RenderLeaf {...props} />, []);
@@ -103,7 +103,7 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
const shortcutToggled = toggleKeyboardShortcut(editor, evt);
if (shortcutToggled) evt.preventDefault();
},
[editor, onKeyDown]
[editor, onKeyDown],
);
const renderPlaceholder = useCallback(
@@ -115,7 +115,7 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
</Text>
</span>
),
[]
[],
);
return (
@@ -160,5 +160,5 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
</Slate>
</div>
);
}
},
);
@@ -51,14 +51,14 @@ export function EmoticonAutocomplete({
const list: Array<EmoticonSearchItem> = [];
return list.concat(
imagePacks.flatMap((pack) => pack.getImages(ImageUsage.Emoticon)),
emojis
emojis,
);
}, [imagePacks]);
const [result, search, resetSearch] = useAsyncSearch(
searchList,
getEmoticonSearchStr,
SEARCH_OPTIONS
SEARCH_OPTIONS,
);
const autoCompleteEmoticon = result ? result.items.slice(0, 20) : recentEmoji;
@@ -91,9 +91,9 @@ export function RoomMentionAutocomplete({
if (alias) return [r.name, alias];
return r.name;
},
[mx]
[mx],
),
SEARCH_OPTIONS
SEARCH_OPTIONS,
);
const autoCompleteRoomIds = result ? result.items.slice(0, 20) : allRooms.slice(0, 20);
@@ -111,7 +111,7 @@ export function RoomMentionAutocomplete({
name.startsWith('#') ? name : `#${name}`,
roomId === roomAliasOrId || mx.getRoom(roomId)?.getCanonicalAlias() === roomAliasOrId,
undefined,
viaServers
viaServers,
);
replaceWithElement(editor, query.range, mentionEl);
moveCursor(editor, true);
@@ -98,7 +98,7 @@ export function UserMentionAutocomplete({
const [result, search, resetSearch] = useAsyncSearch(members, getRoomMemberStr, SEARCH_OPTIONS);
const autoCompleteMembers = (result ? result.items.slice(0, 20) : members.slice(0, 20)).filter(
withAllowedMembership
withAllowedMembership,
);
useEffect(() => {
@@ -110,7 +110,7 @@ export function UserMentionAutocomplete({
const mentionEl = createMentionElement(
uId,
name.startsWith('@') ? name : `@${name}`,
mx.getUserId() === uId || roomAliasOrId === uId
mx.getUserId() === uId || roomAliasOrId === uId,
);
replaceWithElement(editor, query.range, mentionEl);
moveCursor(editor, true);
@@ -22,7 +22,7 @@ export type AutocompleteQuery<TPrefix extends string> = {
export const getAutocompletePrefix = <TPrefix extends string>(
editor: Editor,
queryRange: BaseRange,
validPrefixes: readonly TPrefix[]
validPrefixes: readonly TPrefix[],
): TPrefix | undefined => {
const world = Editor.string(editor, queryRange);
return validPrefixes.find((p) => world.startsWith(p));
@@ -31,13 +31,13 @@ export const getAutocompletePrefix = <TPrefix extends string>(
export const getAutocompleteQueryText = (
editor: Editor,
queryRange: BaseRange,
prefix: string
prefix: string,
): string => Editor.string(editor, queryRange).slice(prefix.length);
export const getAutocompleteQuery = <TPrefix extends string>(
editor: Editor,
queryRange: BaseRange,
validPrefixes: readonly TPrefix[]
validPrefixes: readonly TPrefix[],
): AutocompleteQuery<TPrefix> | undefined => {
const prefix = getAutocompletePrefix(editor, queryRange, validPrefixes);
if (!prefix) return undefined;
+9 -9
View File
@@ -77,7 +77,7 @@ const getInlineNodeMarkType = (node: Element): MarkType | undefined => {
const getInlineMarkElement = (
markType: MarkType,
node: Element,
getChild: (child: ChildNode) => InlineElement[]
getChild: (child: ChildNode) => InlineElement[],
): InlineElement[] => {
const children = node.children.flatMap(getChild);
const mdSequence = node.attribs['data-md'];
@@ -115,7 +115,7 @@ const getInlineNonMarkElement = (node: Element): MentionElement | EmoticonElemen
getText(node) || roomMention.roomIdOrAlias,
false,
undefined,
roomMention.viaServers
roomMention.viaServers,
);
}
const eventMention = parseMatrixToRoomEvent(href);
@@ -125,7 +125,7 @@ const getInlineNonMarkElement = (node: Element): MentionElement | EmoticonElemen
getText(node) || eventMention.roomIdOrAlias,
false,
eventMention.eventId,
eventMention.viaServers
eventMention.viaServers,
);
}
}
@@ -167,7 +167,7 @@ const getInlineElement = (node: ChildNode, processText: ProcessTextCallback): In
const parseBlockquoteNode = (
node: Element,
processText: ProcessTextCallback
processText: ProcessTextCallback,
): BlockQuoteElement[] | ParagraphElement[] => {
const quoteLines: Array<InlineElement[]> = [];
let lineHolder: InlineElement[] = [];
@@ -259,7 +259,7 @@ const parseCodeBlockNode = (node: Element): CodeBlockElement[] | ParagraphElemen
const parseListMarkdown = (
node: Element,
processText: ProcessTextCallback,
depth = 0
depth = 0,
): ParagraphElement[] => {
const md = isTag(node) && node.name === 'ul' ? '*' : '-';
const prefix = node.attribs['data-md'] ?? md;
@@ -269,7 +269,7 @@ const parseListMarkdown = (
const digit = digitOrChar ? parseInt(digitOrChar, 10) : undefined;
const lines: ParagraphElement[] = [];
let lineNo = digit === undefined || Number.isNaN(digit) ? digitOrChar ?? 1 : digit;
let lineNo = digit === undefined || Number.isNaN(digit) ? (digitOrChar ?? 1) : digit;
const pushLine = (line: InlineElement[]) => {
lines.push({
type: BlockType.Paragraph,
@@ -353,7 +353,7 @@ const parseListLines = (children: ChildNode[], processText: ProcessTextCallback)
};
const parseListNode = (
node: Element,
processText: ProcessTextCallback
processText: ProcessTextCallback,
): OrderedListElement[] | UnorderedListElement[] | ParagraphElement[] => {
if (node.attribs['data-md'] !== undefined) {
return parseListMarkdown(node, processText);
@@ -385,7 +385,7 @@ const parseListNode = (
};
const parseHeadingNode = (
node: Element,
processText: ProcessTextCallback
processText: ProcessTextCallback,
): HeadingElement | ParagraphElement => {
const children = getInlineElement(node, processText);
@@ -411,7 +411,7 @@ const parseHeadingNode = (
export const domToEditorInput = (
domNodes: ChildNode[],
processText: ProcessTextCallback,
processLineStartText: ProcessTextCallback
processLineStartText: ProcessTextCallback,
): Descendant[] => {
const children: Descendant[] = [];
+3 -3
View File
@@ -74,7 +74,7 @@ const elementToCustomHtml = (node: CustomElement, children: string): string => {
case BlockType.Emoticon:
return node.key.startsWith('mxc://')
? `<img data-mx-emoticon src="${node.key}" alt="${sanitizeText(
node.shortcode
node.shortcode,
)}" title="${sanitizeText(node.shortcode)}" height="32" />`
: sanitizeText(node.key);
case BlockType.Link:
@@ -92,12 +92,12 @@ const ignoreHTMLParseInlineMD = (text: string): string =>
text,
HTML_TAG_REG_G,
(match) => match[0],
(txt) => parseInlineMD(txt)
(txt) => parseInlineMD(txt),
).join('');
export const toMatrixCustomHTML = (
node: Descendant | Descendant[],
opts: OutputOptions
opts: OutputOptions,
): string => {
let markdownLines = '';
const parseNode = (n: Descendant, index: number, targetNodes: Descendant[]) => {
+3 -3
View File
@@ -160,7 +160,7 @@ export const createMentionElement = (
name: string,
highlight: boolean,
eventId?: string,
viaServers?: string[]
viaServers?: string[],
): MentionElement => ({
type: BlockType.Mention,
id,
@@ -180,7 +180,7 @@ export const createEmoticonElement = (key: string, shortcode: string): EmoticonE
export const createLinkElement = (
href: string,
children: string | FormattedText[]
children: string | FormattedText[],
): LinkElement => ({
type: BlockType.Link,
href,
@@ -213,7 +213,7 @@ interface PointUntilCharOptions {
export const getPointUntilChar = (
editor: Editor,
cursorPoint: BasePoint,
options: PointUntilCharOptions
options: PointUntilCharOptions,
): BasePoint | undefined => {
let targetPoint: BasePoint | undefined;
let prevPoint: BasePoint | undefined;
@@ -71,7 +71,7 @@ type StickerGroupItem = {
const useGroups = (
tab: EmojiBoardTab,
imagePacks: ImagePack[]
imagePacks: ImagePack[],
): [EmojiGroupItem[], StickerGroupItem[]] => {
const mx = useMatrixClient();
@@ -309,7 +309,7 @@ function EmojiGroupHolder({
shortcode: emojiInfo.shortcode,
});
},
[setPreviewData]
[setPreviewData],
);
const throttleEmojiHover = useThrottle(handleEmojiPreview, {
@@ -385,7 +385,7 @@ export function EmojiBoard({
const previewAtom = useMemo(
() => createPreviewDataAtom(emojiTab ? DefaultEmojiPreview : undefined),
[emojiTab]
[emojiTab],
);
const activeGroupIdAtom = useMemo(() => atom<string | undefined>(undefined), []);
const setActiveGroupId = useSetAtom(activeGroupIdAtom);
@@ -404,7 +404,7 @@ export function EmojiBoard({
const [result, search, resetSearch] = useAsyncSearch(
searchList,
getEmoticonSearchStr,
SEARCH_OPTIONS
SEARCH_OPTIONS,
);
const searchedItems = result?.items.slice(0, 100);
@@ -416,9 +416,9 @@ export function EmojiBoard({
if (term) search(term);
else resetSearch();
},
[search, resetSearch]
[search, resetSearch],
),
{ wait: 200 }
{ wait: 200 },
);
const contentScrollRef = useRef<HTMLDivElement>(null);
@@ -17,5 +17,5 @@ export const useEmojiGroupIcons = (): IEmojiGroupIcons =>
[EmojiGroupId.Symbol]: Icons.Peace,
[EmojiGroupId.Flag]: Icons.Flag,
}),
[]
[],
);
@@ -15,5 +15,5 @@ export const useEmojiGroupLabels = (): IEmojiGroupLabels =>
[EmojiGroupId.Symbol]: 'Symbols',
[EmojiGroupId.Flag]: 'Flags',
}),
[]
[],
);
@@ -104,7 +104,8 @@ export const EventReaders = as<'div', EventReadersProps>(
const name = getName(readerId);
const avatarMxcUrl = room.getMember(readerId)?.getMxcAvatarUrl();
const avatarUrl = avatarMxcUrl
? mxcUrlToHttp(mx, avatarMxcUrl, useAuthentication, 100, 100, 'crop') ?? undefined
? (mxcUrlToHttp(mx, avatarMxcUrl, useAuthentication, 100, 100, 'crop') ??
undefined)
: undefined;
const receiptTs = room.getReadReceiptForUserId(readerId)?.data.ts;
@@ -119,7 +120,7 @@ export const EventReaders = as<'div', EventReadersProps>(
space?.roomId,
readerId,
getMouseEventCords(event.nativeEvent),
'Bottom'
'Bottom',
);
}}
before={
@@ -162,5 +163,5 @@ export const EventReaders = as<'div', EventReadersProps>(
</Box>
</Box>
);
}
},
);
@@ -47,5 +47,5 @@ export const ImageEditor = as<'div', ImageEditorProps>(
</Box>
</Box>
);
}
},
);
@@ -57,7 +57,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
Array.from(savedImages).find(([, img]) => img.shortcode === shortcode) !== undefined;
return hasInSaved;
},
[imagePack, savedImages, uploadedImages]
[imagePack, savedImages, uploadedImages],
);
const pickFiles = useFilePicker(
@@ -74,9 +74,9 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
setFiles((f) => [...f, ...uniqueFiles]);
},
[hasImageWithShortcode]
[hasImageWithShortcode],
),
true
true,
);
const handleMetaSave = useCallback(
@@ -88,10 +88,10 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
...imagePack.meta.content,
...m?.content,
...editedMeta.content,
})
}),
);
},
[imagePack.meta]
[imagePack.meta],
);
const handleMetaCancel = () => setMetaEditing(false);
@@ -104,10 +104,10 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
...imagePack.meta.content,
...m?.content,
usage: usg,
})
}),
);
},
[imagePack.meta]
[imagePack.meta],
);
const handleUploadRemove = useCallback((file: TUploadContent) => {
@@ -123,13 +123,13 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
};
const image = PackImageReader.fromPackImage(
getFileNameWithoutExt(data.file.name),
packImage
packImage,
);
if (!image) return;
handleUploadRemove(data.file);
setUploadedImages((imgs) => [image, ...imgs]);
},
[handleUploadRemove]
[handleUploadRemove],
);
const handleImageEdit = (shortcode: string) => {
@@ -164,7 +164,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
? new PackImageReader(
suffixRename(image.shortcode, hasImageWithShortcode),
image.url,
image.content
image.content,
)
: image;
@@ -199,7 +199,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
images.forEach((img) => pushImage(img));
return onUpdate?.(pack);
}, [imagePack, images, savedMeta, uploadedImages, savedImages, deleteImages, onUpdate])
}, [imagePack, images, savedMeta, uploadedImages, savedImages, deleteImages, onUpdate]),
);
useEffect(() => {
@@ -384,5 +384,5 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
)}
</Box>
);
}
},
);
@@ -53,7 +53,7 @@ export function ImagePackProfile({ meta, canEdit, onEdit }: ImagePackProfileProp
const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
const avatarUrl = meta.avatar
? mxcUrlToHttp(mx, meta.avatar, useAuthentication) ?? undefined
? (mxcUrlToHttp(mx, meta.avatar, useAuthentication) ?? undefined)
: undefined;
return (
@@ -101,7 +101,7 @@ export function ImagePackProfileEdit({ meta, onCancel, onSave }: ImagePackProfil
const useAuthentication = useMediaAuthentication();
const [avatar, setAvatar] = useState(meta.avatar);
const avatarUrl = avatar ? mxcUrlToHttp(mx, avatar, useAuthentication) ?? undefined : undefined;
const avatarUrl = avatar ? (mxcUrlToHttp(mx, avatar, useAuthentication) ?? undefined) : undefined;
const [imageFile, setImageFile] = useState<File>();
const avatarFileUrl = useObjectURL(imageFile);
@@ -32,7 +32,7 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
{
roomId: room.roomId,
stateKey,
}
},
);
}, [room.roomId, stateKey]);
const imagePack = useRoomImagePack(room, stateKey) ?? fallbackPack;
@@ -46,10 +46,10 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
address.roomId,
StateEvent.PoniesRoomEmotes,
packContent,
address.stateKey
address.stateKey,
);
},
[mx, imagePack]
[mx, imagePack],
);
return (
@@ -29,7 +29,7 @@ export function UsageSelector({ selected, onChange }: UsageSelectorProps) {
const allUsages: ImageUsage[][] = useMemo(
() => [[ImageUsage.Emoticon], [ImageUsage.Sticker], [ImageUsage.Sticker, ImageUsage.Emoticon]],
[]
[],
);
return (
@@ -15,7 +15,7 @@ export function UserImagePack() {
async (packContent: PackContent) => {
await mx.setAccountData(AccountDataEvent.PoniesUserEmotes, packContent);
},
[mx]
[mx],
);
return <ImagePackContent imagePack={imagePack ?? defaultPack} canEdit onUpdate={handleUpdate} />;
@@ -93,5 +93,5 @@ export const ImageViewer = as<'div', ImageViewerProps>(
</Box>
</Box>
);
}
},
);
@@ -69,12 +69,12 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) {
const membership = room.getMember(userId)?.membership;
return membership !== Membership.Join;
}),
[directUsers, room]
[directUsers, room],
);
const [result, search, resetSearch] = useAsyncSearch(
filteredUsers,
getUserIdString,
SEARCH_OPTIONS
SEARCH_OPTIONS,
);
const queryHighlighRegex = result?.query
? makeHighlightRegex(result.query.split(' '))
@@ -85,8 +85,8 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) {
async (userId, reason) => {
await mx.invite(room.roomId, userId, reason);
},
[mx, room]
)
[mx, room],
),
);
const inviting = inviteState.status === AsyncStatus.Loading;
@@ -32,7 +32,7 @@ export function LeaveRoomPrompt({ roomId, onDone, onCancel }: LeaveRoomPromptPro
const [leaveState, leaveRoom] = useAsyncCallback<undefined, MatrixError, []>(
useCallback(async () => {
mx.leave(roomId);
}, [mx, roomId])
}, [mx, roomId]),
);
const handleLeave = () => {
@@ -32,7 +32,7 @@ export function LeaveSpacePrompt({ roomId, onDone, onCancel }: LeaveSpacePromptP
const [leaveState, leaveRoom] = useAsyncCallback<undefined, MatrixError, []>(
useCallback(async () => {
mx.leave(roomId);
}, [mx, roomId])
}, [mx, roomId]),
);
const handleLeave = () => {
+1 -1
View File
@@ -5,5 +5,5 @@ import * as css from './media.css';
export const Image = forwardRef<HTMLImageElement, ImgHTMLAttributes<HTMLImageElement>>(
({ className, alt, ...props }, ref) => (
<img className={classNames(css.Image, className)} alt={alt} {...props} ref={ref} />
)
),
);
+1 -1
View File
@@ -23,5 +23,5 @@ export const MediaControl = as<'div', MediaControlProps>(
{after && <Box direction="Column">{after}</Box>}
{children}
</Box>
)
),
);
+1 -1
View File
@@ -6,5 +6,5 @@ export const Video = forwardRef<HTMLVideoElement, VideoHTMLAttributes<HTMLVideoE
({ className, ...props }, ref) => (
// eslint-disable-next-line jsx-a11y/media-has-caption
<video className={classNames(css.Video, className)} {...props} ref={ref} />
)
),
);
@@ -49,5 +49,5 @@ export const MemberTile = as<'button', MemberTileProps>(
{after}
</AsMemberTile>
);
}
},
);
+3 -3
View File
@@ -36,7 +36,7 @@ export function FileDownloadButton({ filename, url, mimeType, encInfo }: FileDow
const fileURL = URL.createObjectURL(fileContent);
FileSaver.saveAs(fileURL, filename);
return fileURL;
}, [mx, url, useAuthentication, mimeType, encInfo, filename])
}, [mx, url, useAuthentication, mimeType, encInfo, filename]),
);
const downloading = downloadState.status === AsyncStatus.Loading;
@@ -52,8 +52,8 @@ export function FileDownloadButton({ filename, url, mimeType, encInfo }: FileDow
downloading
? 'Downloading...'
: hasError
? 'Download failed, click to retry'
: 'Download file'
? 'Download failed, click to retry'
: 'Download file'
}
>
{downloading ? (
+1 -1
View File
@@ -60,7 +60,7 @@ export function ReactionTooltipMsg({ room, reaction, events }: ReactionTooltipMs
(ev: MatrixEvent) =>
getMemberDisplayName(room, ev.getSender() ?? 'Unknown') ??
getMxIdLocalPart(ev.getSender() ?? 'Unknown') ??
'Unknown'
'Unknown',
);
return (
+4 -4
View File
@@ -34,7 +34,7 @@ export const ReplyLayout = as<'div', ReplyLayoutProps>(
{children}
</Box>
</Box>
)
),
);
export const ThreadIndicator = as<'div'>(({ ...props }, ref) => (
@@ -75,12 +75,12 @@ export const Reply = as<'div', ReplyProps>(
legacyUsernameColor,
...props
},
ref
ref,
) => {
const placeholderWidth = useMemo(() => randomNumberBetween(40, 400), []);
const getFromLocalTimeline = useCallback(
() => timelineSet?.findEventById(replyEventId),
[timelineSet, replyEventId]
[timelineSet, replyEventId],
);
const replyEvent = useRoomEvent(room, replyEventId, getFromLocalTimeline);
@@ -134,5 +134,5 @@ export const Reply = as<'div', ReplyProps>(
</ReplyLayout>
</Box>
);
}
},
);
+1 -1
View File
@@ -41,5 +41,5 @@ export const Time = as<'span', TimeProps & ComponentProps<typeof Text>>(
{time}
</Text>
);
}
},
);
@@ -12,7 +12,7 @@ export const Attachment = as<'div', css.AttachmentVariants>(
{...props}
ref={ref}
/>
)
),
);
export const AttachmentHeader = as<'div'>(({ className, ...props }, ref) => (
@@ -60,7 +60,7 @@ export function AudioContent({
? await downloadEncryptedMedia(mediaUrl, (encBuf) => decryptFile(encBuf, mimeType, encInfo))
: await downloadMedia(mediaUrl);
return URL.createObjectURL(fileContent);
}, [mx, url, useAuthentication, mimeType, encInfo])
}, [mx, url, useAuthentication, mimeType, encInfo]),
);
const audioRef = useRef<HTMLAudioElement | null>(null);
@@ -75,7 +75,7 @@ export function AudioContent({
URL.revokeObjectURL(srcState.data);
}
},
[srcState]
[srcState],
);
const [currentTime, setCurrentTime] = useState(0);
@@ -94,7 +94,7 @@ export function AudioContent({
}, []);
useMediaPlayTimeCallback(
getAudioRef,
useThrottle(handlePlayTimeCallback, PLAY_TIME_THROTTLE_OPS)
useThrottle(handlePlayTimeCallback, PLAY_TIME_THROTTLE_OPS),
);
const handlePlay = () => {
@@ -162,7 +162,7 @@ export function AudioContent({
</Chip>
<Text size="T200">{`${secondsToMinutesAndSeconds(
currentTime
currentTime,
)} / ${secondsToMinutesAndSeconds(duration)}`}</Text>
</>
),
@@ -12,7 +12,7 @@ export const MessageDeletedContent = as<'div', { children?: never; reason?: stri
{reason ? `This message has been deleted — ${reason}` : 'This message has been deleted'}
</i>
</Box>
)
),
);
export const MessageUnsupportedContent = as<'div', { children?: never }>(({ ...props }, ref) => (
@@ -95,7 +95,7 @@ export function ReadTextFile({ body, mimeType, url, encInfo, renderViewer }: Rea
const text = fileContent.text();
setTextViewer(true);
return text;
}, [mx, useAuthentication, mimeType, encInfo, url])
}, [mx, useAuthentication, mimeType, encInfo, url]),
);
return (
@@ -184,7 +184,7 @@ export function ReadPdfFile({ body, mimeType, url, encInfo, renderViewer }: Read
: await downloadMedia(mediaUrl);
setPdfViewer(true);
return URL.createObjectURL(fileContent);
}, [mx, url, useAuthentication, mimeType, encInfo])
}, [mx, url, useAuthentication, mimeType, encInfo]),
);
return (
@@ -264,7 +264,7 @@ export function DownloadFile({ body, mimeType, url, info, encInfo }: DownloadFil
const fileURL = URL.createObjectURL(fileContent);
FileSaver.saveAs(fileURL, body);
return fileURL;
}, [mx, url, useAuthentication, mimeType, encInfo, body])
}, [mx, url, useAuthentication, mimeType, encInfo, body]),
);
return downloadState.status === AsyncStatus.Error ? (
@@ -309,5 +309,5 @@ export const FileContent = as<'div', FileContentProps>(
{mimeType === 'application/pdf' && renderAsPdfFile()}
{children}
</Box>
)
),
);
@@ -74,7 +74,7 @@ export const ImageContent = as<'div', ImageContentProps>(
renderImage,
...props
},
ref
ref,
) => {
const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
@@ -91,12 +91,12 @@ export const ImageContent = as<'div', ImageContentProps>(
if (!mediaUrl) throw new Error('Invalid media URL');
if (encInfo) {
const fileContent = await downloadEncryptedMedia(mediaUrl, (encBuf) =>
decryptFile(encBuf, mimeType ?? FALLBACK_MIMETYPE, encInfo)
decryptFile(encBuf, mimeType ?? FALLBACK_MIMETYPE, encInfo),
);
return URL.createObjectURL(fileContent);
}
return mediaUrl;
}, [mx, url, useAuthentication, mimeType, encInfo])
}, [mx, url, useAuthentication, mimeType, encInfo]),
);
const handleLoad = () => {
@@ -257,5 +257,5 @@ export const ImageContent = as<'div', ImageContentProps>(
)}
</Box>
);
}
},
);
@@ -34,7 +34,7 @@ function computeVotes(
mx: ReturnType<typeof useMatrixClient>,
roomId: string,
eventId: string,
isStable: boolean
isStable: boolean,
): VoteState {
const empty: VoteState = { counts: new Map(), myVote: null, total: 0 };
const room = mx.getRoom(roomId);
@@ -44,12 +44,12 @@ function computeVotes(
const stableRels = timelineSet.relations.getChildEventsForEvent(
eventId,
'm.reference',
'm.poll.response'
'm.poll.response',
);
const unstableRels = timelineSet.relations.getChildEventsForEvent(
eventId,
'org.matrix.msc3381.poll.response' as any,
'org.matrix.msc3381.poll.response'
'org.matrix.msc3381.poll.response',
);
// Collect all response events; per-sender keep only latest
@@ -129,12 +129,12 @@ export function PollContent({
const stableRels = timelineSet.relations.getChildEventsForEvent(
eventId,
'm.reference',
'm.poll.response'
'm.poll.response',
);
const unstableRels = timelineSet.relations.getChildEventsForEvent(
eventId,
'org.matrix.msc3381.poll.response' as any,
'org.matrix.msc3381.poll.response'
'org.matrix.msc3381.poll.response',
);
stableRels?.on(RelationsEvent.Add, refresh);
@@ -27,13 +27,13 @@ export function ThumbnailContent({ info, renderImage }: ThumbnailContentProps) {
if (!mediaUrl) throw new Error('Invalid media URL');
if (encInfo) {
const fileContent = await downloadEncryptedMedia(mediaUrl, (encBuf) =>
decryptFile(encBuf, thumbInfo.mimetype ?? FALLBACK_MIMETYPE, encInfo)
decryptFile(encBuf, thumbInfo.mimetype ?? FALLBACK_MIMETYPE, encInfo),
);
return URL.createObjectURL(fileContent);
}
return mediaUrl;
}, [mx, info, useAuthentication])
}, [mx, info, useAuthentication]),
);
useEffect(() => {
@@ -69,7 +69,7 @@ export const VideoContent = as<'div', VideoContentProps>(
renderVideo,
...props
},
ref
ref,
) => {
const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
@@ -85,11 +85,11 @@ export const VideoContent = as<'div', VideoContentProps>(
if (!mediaUrl) throw new Error('Invalid media URL');
const fileContent = encInfo
? await downloadEncryptedMedia(mediaUrl, (encBuf) =>
decryptFile(encBuf, mimeType, encInfo)
decryptFile(encBuf, mimeType, encInfo),
)
: await downloadMedia(mediaUrl);
return URL.createObjectURL(fileContent);
}, [mx, url, useAuthentication, mimeType, encInfo])
}, [mx, url, useAuthentication, mimeType, encInfo]),
);
const handleLoad = () => {
@@ -237,5 +237,5 @@ export const VideoContent = as<'div', VideoContentProps>(
)}
</Box>
);
}
},
);
+3 -3
View File
@@ -8,12 +8,12 @@ export const MessageBase = as<'div', css.MessageBaseVariants>(
<div
className={classNames(
css.MessageBase({ highlight, selected, collapse, autoCollapse, space }),
className
className,
)}
{...props}
ref={ref}
/>
)
),
);
export const AvatarBase = as<'span'>(({ className, ...props }, ref) => (
@@ -38,5 +38,5 @@ export const MessageTextBody = as<'div', css.MessageTextBodyVariants & { notice?
{...props}
ref={ref}
/>
)
),
);
+1 -1
View File
@@ -59,5 +59,5 @@ export const BubbleLayout = as<'div', BubbleLayoutProps>(
)}
</Box>
</Box>
)
),
);
@@ -14,5 +14,5 @@ export const CompactLayout = as<'div', CompactLayoutProps>(
</Box>
{children}
</Box>
)
),
);
@@ -23,5 +23,5 @@ export const CompactPlaceholder = as<'div', { variant?: ContainerColor }>(
<LinePlaceholder variant={variant} style={{ maxWidth: toRem(msgSize) }} />
</CompactLayout>
);
}
},
);
@@ -35,5 +35,5 @@ export const DefaultPlaceholder = as<'div', { variant?: ContainerColor }>(
</Box>
</ModernLayout>
);
}
},
);
@@ -11,5 +11,5 @@ export const LinePlaceholder = as<'div', css.LinePlaceholderVariants>(
{...props}
ref={ref}
/>
)
),
);
+1 -1
View File
@@ -15,5 +15,5 @@ export const NavCategoryHeader = as<'div', NavCategoryHeaderProps>(
{...props}
ref={ref}
/>
)
),
);
+2 -2
View File
@@ -23,11 +23,11 @@ export const NavItem = as<
export const NavLink = forwardRef<HTMLAnchorElement, ComponentProps<typeof Link>>(
({ className, ...props }, ref) => (
<Link className={classNames(css.NavLink, className)} {...props} ref={ref} />
)
),
);
export const NavButton = as<'button'>(
({ as: AsNavButton = 'button', className, ...props }, ref) => (
<AsNavButton className={classNames(css.NavLink, className)} {...props} ref={ref} />
)
),
);
+1 -1
View File
@@ -6,5 +6,5 @@ import * as css from './styles.css';
export const NavItemContent = as<'p', ComponentProps<typeof Text>>(
({ className, ...props }, ref) => (
<Text className={classNames(css.NavItemContent, className)} size="T300" {...props} ref={ref} />
)
),
);
+1 -1
View File
@@ -13,5 +13,5 @@ export const NavItemOptions = as<'div', ComponentProps<typeof Box>>(
{...props}
ref={ref}
/>
)
),
);
+3 -3
View File
@@ -53,7 +53,7 @@ export const PageNavHeader = as<'header', css.PageNavHeaderVariants>(
{...props}
ref={ref}
/>
)
),
);
export function PageNavContent({
@@ -98,7 +98,7 @@ export const PageHeader = as<'div', css.PageHeaderVariants>(
{...props}
ref={ref}
/>
)
),
);
export const PageContent = as<'div'>(({ className, ...props }, ref) => (
@@ -127,7 +127,7 @@ export const PageHeroSection = as<'div', ComponentProps<typeof Box>>(
{...props}
ref={ref}
/>
)
),
);
export function PageHero({
@@ -42,5 +42,5 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
)}
</UseStateProvider>
);
}
},
);
+1 -1
View File
@@ -17,5 +17,5 @@ export const PowerColorBadge = as<'span', PowerColorBadgeProps>(
{...props}
ref={ref}
/>
)
),
);
+1 -1
View File
@@ -46,7 +46,7 @@ export const PowerSelector = forwardRef<HTMLDivElement, PowerSelectorProps>(
</Scroll>
</Box>
</Menu>
)
),
);
type PowerSwitcherProps = PowerSelectorProps & {
+1 -1
View File
@@ -76,5 +76,5 @@ export const AvatarPresence = as<'div', AvatarPresenceProps>(
)}
{children}
</Box>
)
),
);
@@ -93,7 +93,7 @@ export function ReadReceiptAvatars({
const name = getMemberDisplayName(room, userId) ?? getMxIdLocalPart(userId) ?? userId;
const avatarMxc = room.getMember(userId)?.getMxcAvatarUrl();
const avatarUrl = avatarMxc
? mxcUrlToHttp(mx, avatarMxc, useAuthentication, 32, 32, 'crop') ?? undefined
? (mxcUrlToHttp(mx, avatarMxc, useAuthentication, 32, 32, 'crop') ?? undefined)
: undefined;
return (
<StackedAvatar
+10 -7
View File
@@ -50,7 +50,7 @@ export function RoomCardGrid({ children }: { children: ReactNode }) {
useElementSizeObserver(
useCallback(() => gridRef.current, []),
useCallback((width, _, target) => setGridColumnCount(target, getGridColumnCount(width)), [])
useCallback((width, _, target) => setGridColumnCount(target, getGridColumnCount(width)), []),
);
return (
@@ -159,14 +159,14 @@ export const RoomCard = as<'div', RoomCardProps>(
renderTopicViewer,
...props
},
ref
ref,
) => {
const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
const joinedRoomId = useJoinedRoomId(allRooms, roomIdOrAlias);
const joinedRoom = mx.getRoom(joinedRoomId);
const [topicEvent, setTopicEvent] = useState(() =>
joinedRoom ? getStateEvent(joinedRoom, StateEvent.RoomTopic) : undefined
joinedRoom ? getStateEvent(joinedRoom, StateEvent.RoomTopic) : undefined,
);
const fallbackName = getMxIdLocalPart(roomIdOrAlias) ?? roomIdOrAlias;
@@ -193,12 +193,15 @@ export const RoomCard = as<'div', RoomCardProps>(
setTopicEvent(getStateEvent(joinedRoom, StateEvent.RoomTopic));
}
},
[joinedRoom]
)
[joinedRoom],
),
);
const [joinState, join] = useAsyncCallback<Room, MatrixError, []>(
useCallback(() => mx.joinRoom(roomIdOrAlias, { viaServers }), [mx, roomIdOrAlias, viaServers])
useCallback(
() => mx.joinRoom(roomIdOrAlias, { viaServers }),
[mx, roomIdOrAlias, viaServers],
),
);
const joining =
joinState.status === AsyncStatus.Loading || joinState.status === AsyncStatus.Success;
@@ -316,5 +319,5 @@ export const RoomCard = as<'div', RoomCardProps>(
)}
</RoomCardBase>
);
}
},
);
+1 -1
View File
@@ -43,7 +43,7 @@ export const RoomIntro = as<'div', RoomIntroProps>(({ room, ...props }, ref) =>
const prevRoomId = createContent?.predecessor?.room_id;
const [prevRoomState, joinPrevRoom] = useAsyncCallback(
useCallback(async (roomId: string) => mx.joinRoom(roomId), [mx])
useCallback(async (roomId: string) => mx.joinRoom(roomId), [mx]),
);
const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock');
@@ -27,10 +27,10 @@ export const ScrollTopContainer = as<
onVisibilityChange?.(entry.isIntersecting);
}
},
[anchorRef, onVisibilityChange]
[anchorRef, onVisibilityChange],
),
useCallback(() => ({ root: scrollRef?.current }), [scrollRef]),
useCallback(() => anchorRef.current, [anchorRef])
useCallback(() => anchorRef.current, [anchorRef]),
);
if (onTop) return null;
@@ -20,19 +20,19 @@ export const SequenceCard = as<
mergeBorder,
...props
},
ref
ref,
) => (
<Box
as={AsSequenceCard}
className={classNames(
css.SequenceCard({ radii, outlined, mergeBorder }),
ContainerColor({ variant }),
className
className,
)}
data-first-child={firstChild}
data-last-child={lastChild}
{...props}
ref={ref}
/>
)
),
);
+5 -5
View File
@@ -10,7 +10,7 @@ export const SidebarItem = as<'div', css.SidebarItemVariants>(
{...props}
ref={ref}
/>
)
),
);
export const SidebarItemBadge = as<'div', css.SidebarItemBadgeVariants>(
@@ -20,7 +20,7 @@ export const SidebarItemBadge = as<'div', css.SidebarItemBadgeVariants>(
{...props}
ref={ref}
/>
)
),
);
export function SidebarItemTooltip({
@@ -57,7 +57,7 @@ export const SidebarAvatar = as<'div', css.SidebarAvatarVariants & ComponentProp
{...props}
ref={ref}
/>
)
),
);
export const SidebarFolder = as<'div', css.SidebarFolderVariants>(
@@ -67,7 +67,7 @@ export const SidebarFolder = as<'div', css.SidebarFolderVariants>(
{...props}
ref={ref}
/>
)
),
);
export const SidebarFolderDropTarget = as<'div', css.SidebarFolderDropTargetVariants>(
@@ -77,5 +77,5 @@ export const SidebarFolderDropTarget = as<'div', css.SidebarFolderDropTargetVari
{...props}
ref={ref}
/>
)
),
);
+1 -1
View File
@@ -6,5 +6,5 @@ import * as css from './Sidebar.css';
export const SidebarStack = as<'div'>(
({ as: AsSidebarStack = 'div', className, ...props }, ref) => (
<AsSidebarStack className={classNames(css.SidebarStack, className)} {...props} ref={ref} />
)
),
);
@@ -14,5 +14,5 @@ export const StackedAvatar = as<'span', css.StackedAvatarVariants & StackedAvata
{...props}
ref={ref}
/>
)
),
);
@@ -28,7 +28,7 @@ export const TextViewerContent = forwardRef<HTMLPreElement, TextViewerContentPro
</Suspense>
</ErrorBoundary>
</Text>
)
),
);
export type TextViewerProps = {
@@ -83,5 +83,5 @@ export const TextViewer = as<'div', TextViewerProps>(
</Box>
</Box>
);
}
},
);
+1 -1
View File
@@ -125,5 +125,5 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
</Box>
</Menu>
);
}
},
);
+1 -1
View File
@@ -149,5 +149,5 @@ export const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(
</Box>
</Menu>
);
}
},
);
@@ -21,5 +21,5 @@ export const TypingIndicator = as<'div', TypingIndicatorProps>(
<span className={css.TypingDot({ size, index: '1', animated: !disableAnimation })} />
<span className={css.TypingDot({ size, index: '2', animated: !disableAnimation })} />
</Box>
)
),
);
+2 -2
View File
@@ -103,14 +103,14 @@ export function EmailStageDialog({
session,
});
},
[submitAuthDict, session, clientSecret]
[submitAuthDict, session, clientSecret],
);
const handleEmailSubmit = useCallback(
(userEmail: string) => {
requestEmailToken(userEmail, clientSecret);
},
[clientSecret, requestEmailToken]
[clientSecret, requestEmailToken],
);
useEffect(() => {
@@ -91,7 +91,7 @@ export function RegistrationTokenStageDialog({
session,
});
},
[session, submitAuthDict]
[session, submitAuthDict],
);
useEffect(() => {
+1 -1
View File
@@ -47,7 +47,7 @@ export function AutoTermsStageDialog({ stageData, submitAuthDict, onCancel }: St
type: AuthType.Terms,
session,
}),
[session, submitAuthDict]
[session, submitAuthDict],
);
useEffect(() => {
@@ -59,14 +59,14 @@ export function UploadBoardHeader({
}
return acc;
},
{ loaded: 0, total: 0 }
{ loaded: 0, total: 0 },
);
const handleSend = async () => {
if (sendingRef.current) return;
sendingRef.current = true;
await onSend(
uploads.filter((upload) => upload.status === UploadStatus.Success) as UploadSuccess[]
uploads.filter((upload) => upload.status === UploadStatus.Success) as UploadSuccess[],
);
sendingRef.current = false;
};
@@ -28,7 +28,7 @@ export const UploadCard = forwardRef<HTMLDivElement, UploadCardProps & css.Uploa
</Box>
{bottom}
</Box>
)
),
);
type UploadCardProgressProps = {
@@ -24,7 +24,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
const useAuthentication = useMediaAuthentication();
const [viewer, setViewer] = useState(false);
const [previewStatus, loadPreview] = useAsyncCallback(
useCallback(() => mx.getUrlPreview(url, ts), [url, ts, mx])
useCallback(() => mx.getUrlPreview(url, ts), [url, ts, mx]),
);
useEffect(() => {
@@ -41,7 +41,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
256,
256,
'scale',
false
false,
);
const imgUrl = mxcUrlToHttp(mx, prev['og:image'] || '', useAuthentication);
@@ -105,7 +105,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
)}
</UrlPreview>
);
}
},
);
export const UrlPreviewHolder = as<'div'>(({ children, ...props }, ref) => {
@@ -133,8 +133,8 @@ export const UrlPreviewHolder = as<'div'>(({ children, ...props }, ref) => {
root: scrollRef.current,
rootMargin: '10px',
}),
[]
)
[],
),
);
useEffect(() => {
@@ -62,7 +62,7 @@ export function CreatorChip() {
openSpaceSettings(
room.roomId,
space?.roomId,
SpaceSettingsPage.PermissionsPage
SpaceSettingsPage.PermissionsPage,
);
} else {
openRoomSettings(room.roomId, space?.roomId, RoomSettingsPage.PermissionsPage);
@@ -187,8 +187,8 @@ export function PowerChip({ userId }: { userId: string }) {
async (power: number) => {
await mx.setPowerLevel(room.roomId, userId, power);
},
[mx, userId, room]
)
[mx, userId, room],
),
);
const changing = powerState.status === AsyncStatus.Loading;
const error = powerState.status === AsyncStatus.Error;
@@ -301,13 +301,13 @@ export function PowerChip({ userId }: { userId: string }) {
openSpaceSettings(
room.roomId,
space?.roomId,
SpaceSettingsPage.PermissionsPage
SpaceSettingsPage.PermissionsPage,
);
} else {
openRoomSettings(
room.roomId,
space?.roomId,
RoomSettingsPage.PermissionsPage
RoomSettingsPage.PermissionsPage,
);
}
close();
@@ -459,7 +459,7 @@ export function OptionsChip({ userId }: { userId: string }) {
const users = ignoredUsers.filter((u) => u !== userId);
if (!ignored) users.push(userId);
await mx.setIgnoredUsers(users);
}, [mx, ignoredUsers, userId, ignored])
}, [mx, ignoredUsers, userId, ignored]),
);
const ignoring = ignoreState.status === AsyncStatus.Loading;

Some files were not shown because too many files have changed in this diff Show More