chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
CI / Build & Quality Checks (push) Successful in 10m13s

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

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