mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 17:35:28 +00:00
Compare commits
85 Commits
production
...
mentioneve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87dfca26d7 | ||
|
|
9e293e0a30 | ||
|
|
d957fbd5dc | ||
|
|
0a8b70c8ed | ||
|
|
07d74a4ef4 | ||
|
|
38ab8a7801 | ||
|
|
bccf1eebae | ||
|
|
135dbe2da4 | ||
|
|
f95d3d27d8 | ||
|
|
3d41a016cf | ||
|
|
f9c2fcec56 | ||
|
|
18243f0207 | ||
|
|
7750276554 | ||
|
|
97a6c7d399 | ||
|
|
ac2beaf549 | ||
|
|
bf951e59ee | ||
|
|
03f9f7673d | ||
|
|
478d375125 | ||
|
|
cb6296a96e | ||
|
|
48a9d7d370 | ||
|
|
5de18192b2 | ||
|
|
ef4218d12b | ||
|
|
df4f6578f7 | ||
|
|
28c897ac3d | ||
|
|
86e8424e46 | ||
|
|
5e66bc8dc4 | ||
|
|
00e6ead9bd | ||
|
|
0f0808aa56 | ||
|
|
c972e6813f | ||
|
|
61304f18c2 | ||
|
|
2722d0a854 | ||
|
|
dfd96c449a | ||
|
|
9eca58dda1 | ||
|
|
6cf0ef95ad | ||
|
|
d3661170a4 | ||
|
|
5b6546b761 | ||
|
|
c25ecc12b2 | ||
|
|
60fdb5c091 | ||
|
|
472e6e07b5 | ||
|
|
15e8e10151 | ||
|
|
782a9b54ba | ||
|
|
f52ede1c21 | ||
|
|
7fef354fe6 | ||
|
|
d4e0f19f95 | ||
|
|
fe63c6633f | ||
|
|
be3565871c | ||
|
|
bc604c0157 | ||
|
|
8c183b530b | ||
|
|
9bbc22b091 | ||
|
|
0d5ffb4df8 | ||
|
|
9d83d7cc1c | ||
|
|
534b9227de | ||
|
|
5363ff2572 | ||
|
|
3f1c2be709 | ||
|
|
04027658e6 | ||
|
|
f1594a7b36 | ||
|
|
fa0fcedce5 | ||
|
|
70f5e6fc7e | ||
|
|
9b9ec867da | ||
|
|
fead4ca879 | ||
|
|
449eee006d | ||
|
|
cf691a8462 | ||
|
|
c5ca579c95 | ||
|
|
636367faea | ||
|
|
f20ada7c49 | ||
|
|
75d07ffe0f | ||
|
|
5b600bec20 | ||
|
|
86218a7272 | ||
|
|
9bc052ea87 | ||
|
|
1862db89a3 | ||
|
|
00708bb8f4 | ||
|
|
7e87265ccb | ||
|
|
d55d86aa3c | ||
|
|
c426b6c184 | ||
|
|
4d58ff06f3 | ||
|
|
9f9902ffb1 | ||
|
|
e8989fcffa | ||
|
|
06dea9300c | ||
|
|
c13896244c | ||
|
|
e17e556ee6 | ||
|
|
7441569cfa | ||
|
|
eff1de7c78 | ||
|
|
b733e13ec2 | ||
|
|
e68ceac4f6 | ||
|
|
3f536589e5 |
5
.env
5
.env
@@ -1,2 +1,5 @@
|
|||||||
VITE_API_URL=https://api.revolt.chat
|
# VITE_API_URL=https://api.revolt.chat
|
||||||
|
# VITE_API_URL=https://app.revolt.chat/api
|
||||||
|
# VITE_API_URL=http://local.revolt.chat:8000
|
||||||
|
VITE_API_URL=https://app.revolt.chat/api
|
||||||
VITE_THEMES_URL=https://themes.revolt.chat
|
VITE_THEMES_URL=https://themes.revolt.chat
|
||||||
|
|||||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
## Please make sure to check the following tasks before opening and submitting a PR
|
## Please make sure to check the following tasks before opening and submitting a PR
|
||||||
|
|
||||||
* [ ] I understand and have followed the [contribution guide](https://github.com/revoltchat/revolt/discussions/282)
|
* [ ] I understand and have followed the [contribution guide](https://developers.revolt.chat/contrib.html)
|
||||||
* [ ] I have tested my changes locally and they are working as intended
|
* [ ] I have tested my changes locally and they are working as intended
|
||||||
* [ ] These changes do not have any notable side effects on other Revolt projects
|
* [ ] These changes do not have any notable side effects on other Revolt projects
|
||||||
* [ ] (optional) I have opened a pull request on [the translation repository](https://github.com/revoltchat/translations)
|
* [ ] (optional) I have opened a pull request on [the translation repository](https://github.com/revoltchat/translations)
|
||||||
|
|||||||
57
.github/workflows/docker.yml
vendored
57
.github/workflows/docker.yml
vendored
@@ -30,55 +30,18 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
architecture: [linux/amd64]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: "recursive"
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache/${{ matrix.architecture }}
|
|
||||||
key: ${{ runner.os }}-buildx-${{ matrix.architecture }}-${{ github.sha }}
|
|
||||||
- name: Build
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: ${{ matrix.architecture }}
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache/${{ matrix.architecture }}
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new/${{ matrix.architecture }},mode=max
|
|
||||||
- name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache/${{ matrix.architecture }}
|
|
||||||
mv /tmp/.buildx-cache-new/${{ matrix.architecture }} /tmp/.buildx-cache/${{ matrix.architecture }}
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [test]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Cache amd64 Docker layers
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache/linux/amd64
|
|
||||||
key: ${{ runner.os }}-buildx-linux/amd64-${{ github.sha }}
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@v3
|
||||||
@@ -86,26 +49,22 @@ jobs:
|
|||||||
images: revoltchat/client, ghcr.io/revoltchat/client
|
images: revoltchat/client, ghcr.io/revoltchat/client
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Login to Github Container Registry
|
- name: Login to Github Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Build and publish
|
- name: Build and publish
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache/linux/amd64
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
||||||
- name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
|
|||||||
16
.github/workflows/mirroring.yml
vendored
16
.github/workflows/mirroring.yml
vendored
@@ -1,16 +0,0 @@
|
|||||||
name: Mirroring
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "master"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
to_gitlab:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: pixta-dev/repository-mirroring-action@v1
|
|
||||||
with:
|
|
||||||
target_repo_url: git@gitlab.com:insert/revolt-vite.git
|
|
||||||
ssh_private_key: ${{ secrets.GITLAB_SSH_PRIVATE_KEY }}
|
|
||||||
4
.github/workflows/triage_pr.yml
vendored
4
.github/workflows/triage_pr.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
gh api graphql -f query='
|
gh api graphql -f query='
|
||||||
query {
|
query {
|
||||||
organization(login: "revoltchat"){
|
organization(login: "revoltchat"){
|
||||||
projectV2(number: 3) {
|
projectV2(number: 5) {
|
||||||
id
|
id
|
||||||
fields(first:20) {
|
fields(first:20) {
|
||||||
nodes {
|
nodes {
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||||
echo 'INCOMING_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Incoming PRs") |.id' project_data.json) >> $GITHUB_ENV
|
echo 'INCOMING_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Add PR to project
|
- name: Add PR to project
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ COPY .env.build .env
|
|||||||
|
|
||||||
RUN yarn install --frozen-lockfile
|
RUN yarn install --frozen-lockfile
|
||||||
RUN yarn build:deps
|
RUN yarn build:deps
|
||||||
RUN yarn typecheck
|
# RUN yarn typecheck # lol no
|
||||||
RUN yarn build:highmem
|
RUN yarn build:highmem
|
||||||
RUN yarn workspaces focus --production --all
|
RUN yarn workspaces focus --production --all
|
||||||
|
|
||||||
|
|||||||
27
README.md
27
README.md
@@ -1,3 +1,30 @@
|
|||||||
|
# Deprecation Notice
|
||||||
|
|
||||||
|
This project is deprecated, however it still may receive maintenance updates.
|
||||||
|
|
||||||
|
PRs for small fixes are more than welcome.
|
||||||
|
|
||||||
|
## Deploying a new release
|
||||||
|
|
||||||
|
Ensure `.env.local` points to `https://app.revolt.chat/api`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/deployments/revite
|
||||||
|
git pull
|
||||||
|
git submodule update
|
||||||
|
|
||||||
|
# check:
|
||||||
|
git status
|
||||||
|
|
||||||
|
export REVOLT_SAAS_BRANCH=revite/main
|
||||||
|
export REMOTE=root@production
|
||||||
|
scripts/publish.sh
|
||||||
|
|
||||||
|
# SSH in and restart revite:
|
||||||
|
ssh $REMOTE
|
||||||
|
tmux a -t 4
|
||||||
|
```
|
||||||
|
|
||||||
# Revite
|
# Revite
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|||||||
2
external/components
vendored
2
external/components
vendored
Submodule external/components updated: e79862b597...4be02430c7
2
external/lang
vendored
2
external/lang
vendored
Submodule external/lang updated: 7f87139f79...bb4bfcfd5a
2
external/revolt.js
vendored
2
external/revolt.js
vendored
Submodule external/revolt.js updated: 29df60f782...cd9e84a337
@@ -44,8 +44,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@revoltchat/rehype-katex": "6.0.3-patch.1",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.0",
|
||||||
"klaw": "^3.0.0",
|
"klaw": "^3.0.0",
|
||||||
|
"lottie-react": "^2.4.0",
|
||||||
"sirv-cli": "^1.0.14",
|
"sirv-cli": "^1.0.14",
|
||||||
"vite": "^3.0.5"
|
"vite": "^3.0.5"
|
||||||
},
|
},
|
||||||
@@ -136,7 +138,6 @@
|
|||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^5.2.0",
|
||||||
"react-scroll": "^1.8.2",
|
"react-scroll": "^1.8.2",
|
||||||
"react-virtuoso": "^2.12.0",
|
"react-virtuoso": "^2.12.0",
|
||||||
"rehype-katex": "^6.0.2",
|
|
||||||
"rehype-prism": "^2.1.3",
|
"rehype-prism": "^2.1.3",
|
||||||
"rehype-react": "^7.1.1",
|
"rehype-react": "^7.1.1",
|
||||||
"remark-breaks": "^3.0.2",
|
"remark-breaks": "^3.0.2",
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ if [ -z "$REMOTE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Remote Directory
|
# Remote Directory
|
||||||
REMOTE_DIR=/root/revite
|
REMOTE_DIR=/root/deployments/revite
|
||||||
|
|
||||||
# Post-install script
|
# Post-install script
|
||||||
POST_INSTALL="pm2 restart revite"
|
POST_INSTALL=""
|
||||||
|
|
||||||
# Assets
|
# Assets
|
||||||
export REVOLT_SAAS=https://github.com/revoltchat/assets
|
export REVOLT_SAAS=https://github.com/revoltchat/assets
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
|
import Lottie, { LottieRefCurrentProps } from "lottie-react";
|
||||||
|
|
||||||
|
import { JSX } from "preact";
|
||||||
|
|
||||||
|
import usernameAnim from "../controllers/modals/components/legacy/usernameUpdateLottie.json";
|
||||||
|
|
||||||
type Element =
|
type Element =
|
||||||
| string
|
| string
|
||||||
| {
|
| {
|
||||||
type: "image";
|
type: "image";
|
||||||
src: string;
|
src: string;
|
||||||
shadow?: boolean;
|
shadow?: boolean;
|
||||||
};
|
}
|
||||||
|
| { type: "element"; element: JSX.Element };
|
||||||
|
|
||||||
export interface ChangelogPost {
|
export interface ChangelogPost {
|
||||||
date: Date;
|
date: Date;
|
||||||
@@ -43,6 +50,33 @@ export const changelogEntries: Record<number, ChangelogPost> = {
|
|||||||
"If you want to learn more about how we're making Revolt safer for you, check out our new blog post :point_right: [https://revolt.chat/posts/improving-user-safety](https://revolt.chat/posts/improving-user-safety)",
|
"If you want to learn more about how we're making Revolt safer for you, check out our new blog post :point_right: [https://revolt.chat/posts/improving-user-safety](https://revolt.chat/posts/improving-user-safety)",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
3: {
|
||||||
|
date: new Date("2023-06-11T15:00:00.000Z"),
|
||||||
|
title: "Usernames are Changing",
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: "element",
|
||||||
|
element: (
|
||||||
|
<Lottie
|
||||||
|
animationData={usernameAnim}
|
||||||
|
style={{
|
||||||
|
background: "var(--secondary-background)",
|
||||||
|
borderRadius: "6px",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
"Revolt has undergone a significant change to its username system, transitioning from unique username handles to a new system of display names and usernames with four-digit number tags called discriminators. The four-digit number tags serve as identifiers to differentiate users with the same username, allowing individuals to select desired usernames that reflect their identity.",
|
||||||
|
{
|
||||||
|
type: "element",
|
||||||
|
element: (
|
||||||
|
<a href="https://revolt.chat/posts/evolving-usernames">
|
||||||
|
Read more on our blog!
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const changelogEntryArray = Object.keys(changelogEntries).map(
|
export const changelogEntryArray = Object.keys(changelogEntries).map(
|
||||||
@@ -1848,109 +1848,109 @@ export const emojiDictionary = {
|
|||||||
england: "🏴",
|
england: "🏴",
|
||||||
scotland: "🏴",
|
scotland: "🏴",
|
||||||
wales: "🏴",
|
wales: "🏴",
|
||||||
...{
|
// ...{
|
||||||
1984: "custom:1984.gif",
|
// 1984: "custom:1984.gif",
|
||||||
KekW: "custom:KekW.png",
|
// KekW: "custom:KekW.png",
|
||||||
amogus: "custom:amogus.gif",
|
// amogus: "custom:amogus.gif",
|
||||||
awaa: "custom:awaa.png",
|
// awaa: "custom:awaa.png",
|
||||||
boohoo: "custom:boohoo.png",
|
// boohoo: "custom:boohoo.png",
|
||||||
boohoo_goes_hard: "custom:boohoo_goes_hard.png",
|
// boohoo_goes_hard: "custom:boohoo_goes_hard.png",
|
||||||
boohoo_shaken: "custom:boohoo_shaken.png",
|
// boohoo_shaken: "custom:boohoo_shaken.png",
|
||||||
cat_arrival: "custom:cat_arrival.gif",
|
// cat_arrival: "custom:cat_arrival.gif",
|
||||||
cat_awson: "custom:cat_awson.png",
|
// cat_awson: "custom:cat_awson.png",
|
||||||
cat_blob: "custom:cat_blob.png",
|
// cat_blob: "custom:cat_blob.png",
|
||||||
cat_bonk: "custom:cat_bonk.png",
|
// cat_bonk: "custom:cat_bonk.png",
|
||||||
cat_concern: "custom:cat_concern.png",
|
// cat_concern: "custom:cat_concern.png",
|
||||||
cat_fast: "custom:cat_fast.gif",
|
// cat_fast: "custom:cat_fast.gif",
|
||||||
cat_kitty: "custom:cat_kitty.png",
|
// cat_kitty: "custom:cat_kitty.png",
|
||||||
cat_lick: "custom:cat_lick.gif",
|
// cat_lick: "custom:cat_lick.gif",
|
||||||
cat_not_like: "custom:cat_not_like.png",
|
// cat_not_like: "custom:cat_not_like.png",
|
||||||
cat_put: "custom:cat_put.gif",
|
// cat_put: "custom:cat_put.gif",
|
||||||
cat_pwease: "custom:cat_pwease.png",
|
// cat_pwease: "custom:cat_pwease.png",
|
||||||
cat_rage: "custom:cat_rage.png",
|
// cat_rage: "custom:cat_rage.png",
|
||||||
cat_sad: "custom:cat_sad.png",
|
// cat_sad: "custom:cat_sad.png",
|
||||||
cat_snuff: "custom:cat_snuff.gif",
|
// cat_snuff: "custom:cat_snuff.gif",
|
||||||
cat_spin: "custom:cat_spin.gif",
|
// cat_spin: "custom:cat_spin.gif",
|
||||||
cat_squish: "custom:cat_squish.gif",
|
// cat_squish: "custom:cat_squish.gif",
|
||||||
cat_stare: "custom:cat_stare.gif",
|
// cat_stare: "custom:cat_stare.gif",
|
||||||
cat_steal: "custom:cat_steal.gif",
|
// cat_steal: "custom:cat_steal.gif",
|
||||||
cat_sussy: "custom:cat_sussy.gif",
|
// cat_sussy: "custom:cat_sussy.gif",
|
||||||
clueless: "custom:clueless.png",
|
// clueless: "custom:clueless.png",
|
||||||
death: "custom:death.gif",
|
// death: "custom:death.gif",
|
||||||
developers: "custom:developers.gif",
|
// developers: "custom:developers.gif",
|
||||||
fastwawa: "custom:fastwawa.gif",
|
// fastwawa: "custom:fastwawa.gif",
|
||||||
ferris: "custom:ferris.png",
|
// ferris: "custom:ferris.png",
|
||||||
ferris_bongo: "custom:ferris_bongo.gif",
|
// ferris_bongo: "custom:ferris_bongo.gif",
|
||||||
ferris_nom: "custom:ferris_nom.png",
|
// ferris_nom: "custom:ferris_nom.png",
|
||||||
ferris_pensive: "custom:ferris_pensive.png",
|
// ferris_pensive: "custom:ferris_pensive.png",
|
||||||
ferris_unsafe: "custom:ferris_unsafe.png",
|
// ferris_unsafe: "custom:ferris_unsafe.png",
|
||||||
flesh: "custom:flesh.png",
|
// flesh: "custom:flesh.png",
|
||||||
flooshed: "custom:flooshed.png",
|
// flooshed: "custom:flooshed.png",
|
||||||
flosh: "custom:flosh.png",
|
// flosh: "custom:flosh.png",
|
||||||
flushee: "custom:flushee.png",
|
// flushee: "custom:flushee.png",
|
||||||
forgor: "custom:forgor.png",
|
// forgor: "custom:forgor.png",
|
||||||
hollow: "custom:hollow.png",
|
// hollow: "custom:hollow.png",
|
||||||
john: "custom:john.png",
|
// john: "custom:john.png",
|
||||||
lightspeed: "custom:lightspeed.png",
|
// lightspeed: "custom:lightspeed.png",
|
||||||
little_guy: "custom:little_guy.png",
|
// little_guy: "custom:little_guy.png",
|
||||||
lmaoooo: "custom:lmaoooo.gif",
|
// lmaoooo: "custom:lmaoooo.gif",
|
||||||
lol: "custom:lol.png",
|
// lol: "custom:lol.png",
|
||||||
looking: "custom:looking.gif",
|
// looking: "custom:looking.gif",
|
||||||
marie: "custom:marie.png",
|
// marie: "custom:marie.png",
|
||||||
marie_furret: "custom:marie_furret.gif",
|
// marie_furret: "custom:marie_furret.gif",
|
||||||
marie_smug: "custom:marie_smug.png",
|
// marie_smug: "custom:marie_smug.png",
|
||||||
megumin: "custom:megumin.png",
|
// megumin: "custom:megumin.png",
|
||||||
michi_above: "custom:michi_above.png",
|
// michi_above: "custom:michi_above.png",
|
||||||
michi_awww: "custom:michi_awww.gif",
|
// michi_awww: "custom:michi_awww.gif",
|
||||||
michi_drag: "custom:michi_drag.gif",
|
// michi_drag: "custom:michi_drag.gif",
|
||||||
michi_flustered: "custom:michi_flustered.png",
|
// michi_flustered: "custom:michi_flustered.png",
|
||||||
michi_glare: "custom:michi_glare.png",
|
// michi_glare: "custom:michi_glare.png",
|
||||||
michi_sus: "custom:michi_sus.png",
|
// michi_sus: "custom:michi_sus.png",
|
||||||
monkaS: "custom:monkaS.png",
|
// monkaS: "custom:monkaS.png",
|
||||||
monkaStare: "custom:monkaStare.png",
|
// monkaStare: "custom:monkaStare.png",
|
||||||
monkey_grr: "custom:monkey_grr.png",
|
// monkey_grr: "custom:monkey_grr.png",
|
||||||
monkey_pensive: "custom:monkey_pensive.png",
|
// monkey_pensive: "custom:monkey_pensive.png",
|
||||||
monkey_zany: "custom:monkey_zany.png",
|
// monkey_zany: "custom:monkey_zany.png",
|
||||||
nazu_sit: "custom:nazu_sit.png",
|
// nazu_sit: "custom:nazu_sit.png",
|
||||||
nazu_sus: "custom:nazu_sus.png",
|
// nazu_sus: "custom:nazu_sus.png",
|
||||||
ok_and: "custom:ok_and.gif",
|
// ok_and: "custom:ok_and.gif",
|
||||||
owo: "custom:owo.png",
|
// owo: "custom:owo.png",
|
||||||
pat: "custom:pat.png",
|
// pat: "custom:pat.png",
|
||||||
pointThink: "custom:pointThink.png",
|
// pointThink: "custom:pointThink.png",
|
||||||
rainbowHype: "custom:rainbowHype.gif",
|
// rainbowHype: "custom:rainbowHype.gif",
|
||||||
rawr: "custom:rawr.png",
|
// rawr: "custom:rawr.png",
|
||||||
rember: "custom:rember.png",
|
// rember: "custom:rember.png",
|
||||||
revolt: "custom:revolt.png",
|
// revolt: "custom:revolt.png",
|
||||||
sickly: "custom:sickly.png",
|
// sickly: "custom:sickly.png",
|
||||||
stare: "custom:stare.png",
|
// stare: "custom:stare.png",
|
||||||
tfyoulookingat: "custom:tfyoulookingat.png",
|
// tfyoulookingat: "custom:tfyoulookingat.png",
|
||||||
thanks: "custom:thanks.png",
|
// thanks: "custom:thanks.png",
|
||||||
thonk: "custom:thonk.png",
|
// thonk: "custom:thonk.png",
|
||||||
trol: "custom:trol.png",
|
// trol: "custom:trol.png",
|
||||||
troll_smile: "custom:troll_smile.gif",
|
// troll_smile: "custom:troll_smile.gif",
|
||||||
uber: "custom:uber.png",
|
// uber: "custom:uber.png",
|
||||||
ubertroll: "custom:ubertroll.png",
|
// ubertroll: "custom:ubertroll.png",
|
||||||
verycool: "custom:verycool.png",
|
// verycool: "custom:verycool.png",
|
||||||
verygood: "custom:verygood.png",
|
// verygood: "custom:verygood.png",
|
||||||
wawafast: "custom:wawafast.gif",
|
// wawafast: "custom:wawafast.gif",
|
||||||
wawastance: "custom:wawastance.png",
|
// wawastance: "custom:wawastance.png",
|
||||||
yeahokayyy: "custom:yeahokayyy.png",
|
// yeahokayyy: "custom:yeahokayyy.png",
|
||||||
yed: "custom:yed.png",
|
// yed: "custom:yed.png",
|
||||||
yems: "custom:yems.png",
|
// yems: "custom:yems.png",
|
||||||
michael: "custom:michael.gif",
|
// michael: "custom:michael.gif",
|
||||||
charle: "custom:charle.gif",
|
// charle: "custom:charle.gif",
|
||||||
sadge: "custom:sadge.webp",
|
// sadge: "custom:sadge.webp",
|
||||||
sus: "custom:sus.webp",
|
// sus: "custom:sus.webp",
|
||||||
chade: "custom:chade.gif",
|
// chade: "custom:chade.gif",
|
||||||
gigachad: "custom:gigachad.webp",
|
// gigachad: "custom:gigachad.webp",
|
||||||
sippy: "custom:sippy.webp",
|
// sippy: "custom:sippy.webp",
|
||||||
ayame_heart: "custom:ayame_heart.png",
|
// ayame_heart: "custom:ayame_heart.png",
|
||||||
catgirl_peek: "custom:catgirl_peek.png",
|
// catgirl_peek: "custom:catgirl_peek.png",
|
||||||
girl_happy: "custom:girl_happy.png",
|
// girl_happy: "custom:girl_happy.png",
|
||||||
hug_plushie: "custom:hug_plushie.png",
|
// hug_plushie: "custom:hug_plushie.png",
|
||||||
huggies: "custom:huggies.png",
|
// huggies: "custom:huggies.png",
|
||||||
noted: "custom:noted.gif",
|
// noted: "custom:noted.gif",
|
||||||
waving: "custom:waving.png",
|
// waving: "custom:waving.png",
|
||||||
mogusvented: "custom:mogusvented.png",
|
// mogusvented: "custom:mogusvented.png",
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Channel, User } from "revolt.js";
|
import { Channel, User, Role } from "revolt.js";
|
||||||
import { Emoji as CustomEmoji } from "revolt.js/esm/maps/Emojis";
|
import { Emoji as CustomEmoji } from "revolt.js/esm/maps/Emojis";
|
||||||
import styled, { css } from "styled-components/macro";
|
import styled, { css } from "styled-components/macro";
|
||||||
|
|
||||||
@@ -29,11 +29,16 @@ export type AutoCompleteState =
|
|||||||
type: "channel";
|
type: "channel";
|
||||||
matches: Channel[];
|
matches: Channel[];
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
type: "role";
|
||||||
|
matches: Role[];
|
||||||
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
export type SearchClues = {
|
export type SearchClues = {
|
||||||
users?: { type: "channel"; id: string } | { type: "all" };
|
users?: { type: "channel"; id: string } | { type: "all" };
|
||||||
channels?: { server: string };
|
channels?: { server: string };
|
||||||
|
roles?: { server: string };
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AutoCompleteProps = {
|
export type AutoCompleteProps = {
|
||||||
@@ -59,7 +64,7 @@ export function useAutoComplete(
|
|||||||
|
|
||||||
function findSearchString(
|
function findSearchString(
|
||||||
el: HTMLTextAreaElement,
|
el: HTMLTextAreaElement,
|
||||||
): ["emoji" | "user" | "channel", string, number] | undefined {
|
): ["emoji" | "user" | "channel" | "role", string, number] | undefined {
|
||||||
if (el.selectionStart === el.selectionEnd) {
|
if (el.selectionStart === el.selectionEnd) {
|
||||||
const cursor = el.selectionStart;
|
const cursor = el.selectionStart;
|
||||||
const content = el.value.slice(0, cursor);
|
const content = el.value.slice(0, cursor);
|
||||||
@@ -71,6 +76,8 @@ export function useAutoComplete(
|
|||||||
return ["user", "", j];
|
return ["user", "", j];
|
||||||
} else if (content[j] === "#") {
|
} else if (content[j] === "#") {
|
||||||
return ["channel", "", j];
|
return ["channel", "", j];
|
||||||
|
} else if (content[j] === "%") {
|
||||||
|
return ["role", "", j];
|
||||||
}
|
}
|
||||||
|
|
||||||
while (j >= 0 && valid.test(content[j])) {
|
while (j >= 0 && valid.test(content[j])) {
|
||||||
@@ -80,7 +87,12 @@ export function useAutoComplete(
|
|||||||
if (j === -1) return;
|
if (j === -1) return;
|
||||||
const current = content[j];
|
const current = content[j];
|
||||||
|
|
||||||
if (current === ":" || current === "@" || current === "#") {
|
if (
|
||||||
|
current === ":" ||
|
||||||
|
current === "@" ||
|
||||||
|
current === "#" ||
|
||||||
|
current === "%"
|
||||||
|
) {
|
||||||
const search = content.slice(j + 1, content.length);
|
const search = content.slice(j + 1, content.length);
|
||||||
const minLen = current === ":" ? 2 : 1;
|
const minLen = current === ":" ? 2 : 1;
|
||||||
|
|
||||||
@@ -90,6 +102,8 @@ export function useAutoComplete(
|
|||||||
? "channel"
|
? "channel"
|
||||||
: current === ":"
|
: current === ":"
|
||||||
? "emoji"
|
? "emoji"
|
||||||
|
: current === "%"
|
||||||
|
? "role"
|
||||||
: "user",
|
: "user",
|
||||||
search.toLowerCase(),
|
search.toLowerCase(),
|
||||||
current === ":" ? j + 1 : j,
|
current === ":" ? j + 1 : j,
|
||||||
@@ -230,6 +244,42 @@ export function useAutoComplete(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === "role" && searchClues?.roles) {
|
||||||
|
const server = client.servers.get(searchClues.roles.server);
|
||||||
|
|
||||||
|
let roles: (Role & { id: string })[] = [];
|
||||||
|
if (server?.roles) {
|
||||||
|
roles = Object.entries(server.roles).map(([id, role]) => ({
|
||||||
|
...role,
|
||||||
|
id,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
const matches = (
|
||||||
|
search.length > 0
|
||||||
|
? roles.filter((role) =>
|
||||||
|
role.name.toLowerCase().match(regex),
|
||||||
|
)
|
||||||
|
: roles
|
||||||
|
)
|
||||||
|
.splice(0, 5)
|
||||||
|
.filter((x) => typeof x !== "undefined");
|
||||||
|
|
||||||
|
if (matches.length > 0) {
|
||||||
|
const currentPosition =
|
||||||
|
state.type !== "none" ? state.selected : 0;
|
||||||
|
|
||||||
|
setState({
|
||||||
|
type: "role",
|
||||||
|
matches,
|
||||||
|
selected: Math.min(currentPosition, matches.length - 1),
|
||||||
|
within: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.type !== "none") {
|
if (state.type !== "none") {
|
||||||
@@ -262,6 +312,14 @@ export function useAutoComplete(
|
|||||||
state.matches[state.selected]._id,
|
state.matches[state.selected]._id,
|
||||||
"> ",
|
"> ",
|
||||||
);
|
);
|
||||||
|
} else if (state.type === "role") {
|
||||||
|
content.splice(
|
||||||
|
index,
|
||||||
|
search.length + 1,
|
||||||
|
"<%",
|
||||||
|
state.matches[state.selected].id,
|
||||||
|
"> ",
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
content.splice(
|
content.splice(
|
||||||
index,
|
index,
|
||||||
@@ -492,7 +550,7 @@ export default function AutoComplete({
|
|||||||
{state.type === "user" &&
|
{state.type === "user" &&
|
||||||
state.matches.map((match, i) => (
|
state.matches.map((match, i) => (
|
||||||
<button
|
<button
|
||||||
key={match}
|
key={match._id}
|
||||||
className={i === state.selected ? "active" : ""}
|
className={i === state.selected ? "active" : ""}
|
||||||
onMouseEnter={() =>
|
onMouseEnter={() =>
|
||||||
(i !== state.selected || !state.within) &&
|
(i !== state.selected || !state.within) &&
|
||||||
@@ -517,7 +575,7 @@ export default function AutoComplete({
|
|||||||
{state.type === "channel" &&
|
{state.type === "channel" &&
|
||||||
state.matches.map((match, i) => (
|
state.matches.map((match, i) => (
|
||||||
<button
|
<button
|
||||||
key={match}
|
key={match._id}
|
||||||
className={i === state.selected ? "active" : ""}
|
className={i === state.selected ? "active" : ""}
|
||||||
onMouseEnter={() =>
|
onMouseEnter={() =>
|
||||||
(i !== state.selected || !state.within) &&
|
(i !== state.selected || !state.within) &&
|
||||||
@@ -539,6 +597,40 @@ export default function AutoComplete({
|
|||||||
{match.name}
|
{match.name}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
{state.type === "role" &&
|
||||||
|
state.matches.map((match, i) => (
|
||||||
|
<button
|
||||||
|
key={match._id}
|
||||||
|
className={i === state.selected ? "active" : ""}
|
||||||
|
onMouseEnter={() =>
|
||||||
|
(i !== state.selected || !state.within) &&
|
||||||
|
setState({
|
||||||
|
...state,
|
||||||
|
selected: i,
|
||||||
|
within: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMouseLeave={() =>
|
||||||
|
state.within &&
|
||||||
|
setState({
|
||||||
|
...state,
|
||||||
|
within: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onClick={onClick}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: "16px",
|
||||||
|
height: "16px",
|
||||||
|
borderRadius: "50%",
|
||||||
|
backgroundColor: match.colour || "#7c7c7c",
|
||||||
|
marginRight: "8px",
|
||||||
|
flexShrink: 0,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{match.name}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</Base>
|
</Base>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ function toCodePoint(rune: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function parseEmoji(emoji: string) {
|
export function parseEmoji(emoji: string) {
|
||||||
if (emoji.startsWith("custom:")) {
|
// if (emoji.startsWith("custom:")) {
|
||||||
return `https://dl.insrt.uk/projects/revolt/emotes/${emoji.substring(
|
// return `https://dl.insrt.uk/projects/revolt/emotes/${emoji.substring(
|
||||||
7,
|
// 7,
|
||||||
)}`;
|
// )}`;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const codepoint = toCodePoint(emoji);
|
const codepoint = toCodePoint(emoji);
|
||||||
return `https://static.revolt.chat/emoji/${EMOJI_PACK}/${codepoint}.svg?rev=${REVISION}`;
|
return `https://static.revolt.chat/emoji/${EMOJI_PACK}/${codepoint}.svg?rev=${REVISION}`;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useTriggerEvents } from "preact-context-menu";
|
|||||||
import { memo } from "preact/compat";
|
import { memo } from "preact/compat";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
|
|
||||||
import { Category, Button } from "@revoltchat/ui";
|
import { Category } from "@revoltchat/ui";
|
||||||
|
|
||||||
import { internalEmit } from "../../../lib/eventEmitter";
|
import { internalEmit } from "../../../lib/eventEmitter";
|
||||||
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
|
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
|
||||||
@@ -33,7 +33,7 @@ import InviteList from "./embed/EmbedInvite";
|
|||||||
interface Props {
|
interface Props {
|
||||||
attachContext?: boolean;
|
attachContext?: boolean;
|
||||||
queued?: QueuedMessage;
|
queued?: QueuedMessage;
|
||||||
message: MessageObject;
|
message: MessageObject & { webhook: { name: string; avatar?: string } };
|
||||||
highlight?: boolean;
|
highlight?: boolean;
|
||||||
contrast?: boolean;
|
contrast?: boolean;
|
||||||
content?: Children;
|
content?: Children;
|
||||||
@@ -63,6 +63,7 @@ const Message = observer(
|
|||||||
? useTriggerEvents("Menu", {
|
? useTriggerEvents("Menu", {
|
||||||
user: message.author_id,
|
user: message.author_id,
|
||||||
contextualChannel: message.channel_id,
|
contextualChannel: message.channel_id,
|
||||||
|
contextualMessage: message._id,
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
})
|
})
|
||||||
: undefined;
|
: undefined;
|
||||||
@@ -137,6 +138,11 @@ const Message = observer(
|
|||||||
<UserIcon
|
<UserIcon
|
||||||
className="avatar"
|
className="avatar"
|
||||||
url={message.generateMasqAvatarURL()}
|
url={message.generateMasqAvatarURL()}
|
||||||
|
override={
|
||||||
|
message.webhook?.avatar
|
||||||
|
? `https://autumn.revolt.chat/avatars/${message.webhook.avatar}`
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
target={user}
|
target={user}
|
||||||
size={36}
|
size={36}
|
||||||
onClick={handleUserClick}
|
onClick={handleUserClick}
|
||||||
@@ -157,6 +163,7 @@ const Message = observer(
|
|||||||
showServerIdentity
|
showServerIdentity
|
||||||
onClick={handleUserClick}
|
onClick={handleUserClick}
|
||||||
masquerade={message.masquerade!}
|
masquerade={message.masquerade!}
|
||||||
|
override={message.webhook?.name}
|
||||||
{...userContext}
|
{...userContext}
|
||||||
/>
|
/>
|
||||||
<MessageDetail
|
<MessageDetail
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ export default observer(({ channel }: Props) => {
|
|||||||
if (!state.draft.has(channel._id)) {
|
if (!state.draft.has(channel._id)) {
|
||||||
setMessage(text);
|
setMessage(text);
|
||||||
} else {
|
} else {
|
||||||
setMessage(`${state.draft.get(channel._id)}\n${text}`);
|
setMessage(`${state.draft.get(channel._id)?.content}\n${text}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ export default observer(({ channel }: Props) => {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const content = state.draft.get(channel._id)?.content?.trim() ?? "";
|
const content = state.draft.get(channel._id)?.content?.trim() ?? "";
|
||||||
if (uploadState.type === "attached") return sendFile(content);
|
if (uploadState.type !== "none") return sendFile(content);
|
||||||
if (content.length === 0) return;
|
if (content.length === 0) return;
|
||||||
|
|
||||||
internalEmit("NewMessages", "hide");
|
internalEmit("NewMessages", "hide");
|
||||||
@@ -406,7 +406,9 @@ export default observer(({ channel }: Props) => {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async function sendFile(content: string) {
|
async function sendFile(content: string) {
|
||||||
if (uploadState.type !== "attached") return;
|
if (uploadState.type !== "attached" && uploadState.type !== "failed")
|
||||||
|
return;
|
||||||
|
|
||||||
const attachments: string[] = [];
|
const attachments: string[] = [];
|
||||||
setMessage;
|
setMessage;
|
||||||
|
|
||||||
@@ -565,6 +567,7 @@ export default observer(({ channel }: Props) => {
|
|||||||
channel.channel_type === "TextChannel"
|
channel.channel_type === "TextChannel"
|
||||||
? { server: channel.server_id! }
|
? { server: channel.server_id! }
|
||||||
: undefined,
|
: undefined,
|
||||||
|
roles: { server: channel.server_id! },
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -744,13 +747,11 @@ export default observer(({ channel }: Props) => {
|
|||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
/>
|
/>
|
||||||
{state.experiments.isEnabled("picker") && (
|
<Action>
|
||||||
<Action>
|
<IconButton onClick={() => setPicker(!picker)}>
|
||||||
<IconButton onClick={() => setPicker(!picker)}>
|
<HappyBeaming size={24} />
|
||||||
<HappyBeaming size={24} />
|
</IconButton>
|
||||||
</IconButton>
|
</Action>
|
||||||
</Action>
|
|
||||||
)}
|
|
||||||
<Action>
|
<Action>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={
|
className={
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default function AttachmentActions({ attachment }: Props) {
|
|||||||
|
|
||||||
const url = client.generateFileURL(attachment);
|
const url = client.generateFileURL(attachment);
|
||||||
const open_url = `${url}/${filename}`;
|
const open_url = `${url}/${filename}`;
|
||||||
const download_url = url?.replace("attachments", "attachments/download");
|
const download_url = url;
|
||||||
|
|
||||||
const filesize = determineFileSize(size);
|
const filesize = determineFileSize(size);
|
||||||
|
|
||||||
@@ -49,10 +49,11 @@ export default function AttachmentActions({ attachment }: Props) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
|
target="_blank"
|
||||||
href={download_url}
|
href={download_url}
|
||||||
className={styles.downloadIcon}
|
className={styles.downloadIcon}
|
||||||
download
|
download
|
||||||
target={isFirefox || window.native ? "_blank" : "_self"}
|
// target={isFirefox || window.native ? "_blank" : "_self"}
|
||||||
rel="noreferrer">
|
rel="noreferrer">
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Download size={24} />
|
<Download size={24} />
|
||||||
|
|||||||
@@ -119,19 +119,18 @@ export const MessageOverlayBar = observer(
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{message.channel?.havePermission("React") &&
|
{message.channel?.havePermission("React") && (
|
||||||
state.experiments.isEnabled("picker") && (
|
<ReactionWrapper
|
||||||
<ReactionWrapper
|
open={reactionsOpen}
|
||||||
open={reactionsOpen}
|
setOpen={setReactionsOpen}
|
||||||
setOpen={setReactionsOpen}
|
message={message}>
|
||||||
message={message}>
|
<Tooltip content="React">
|
||||||
<Tooltip content="React">
|
<Entry>
|
||||||
<Entry>
|
<HappyBeaming size={18} />
|
||||||
<HappyBeaming size={18} />
|
</Entry>
|
||||||
</Entry>
|
</Tooltip>
|
||||||
</Tooltip>
|
</ReactionWrapper>
|
||||||
</ReactionWrapper>
|
)}
|
||||||
)}
|
|
||||||
|
|
||||||
{isAuthor && (
|
{isAuthor && (
|
||||||
<Tooltip content="Edit">
|
<Tooltip content="Edit">
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { Bar } from "./JumpToBottom";
|
|||||||
export default observer(
|
export default observer(
|
||||||
({ channel, last_id }: { channel: Channel; last_id?: string }) => {
|
({ channel, last_id }: { channel: Channel; last_id?: string }) => {
|
||||||
const [hidden, setHidden] = useState(false);
|
const [hidden, setHidden] = useState(false);
|
||||||
|
const [timeAgo, setTimeAgo] = useState("");
|
||||||
const hide = () => setHidden(true);
|
const hide = () => setHidden(true);
|
||||||
|
|
||||||
useEffect(() => setHidden(false), [last_id]);
|
useEffect(() => setHidden(false), [last_id]);
|
||||||
@@ -29,6 +30,14 @@ export default observer(
|
|||||||
return () => document.removeEventListener("keydown", onKeyDown);
|
return () => document.removeEventListener("keydown", onKeyDown);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (last_id) {
|
||||||
|
try {
|
||||||
|
setTimeAgo(dayjs(decodeTime(last_id)).fromNow());
|
||||||
|
} catch (err) {}
|
||||||
|
}
|
||||||
|
}, [last_id]);
|
||||||
|
|
||||||
const renderer = getRenderer(channel);
|
const renderer = getRenderer(channel);
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
if (renderer.state !== "RENDER") return null;
|
if (renderer.state !== "RENDER") return null;
|
||||||
@@ -52,7 +61,7 @@ export default observer(
|
|||||||
<Text
|
<Text
|
||||||
id="app.main.channel.misc.new_messages"
|
id="app.main.channel.misc.new_messages"
|
||||||
fields={{
|
fields={{
|
||||||
time_ago: dayjs(decodeTime(last_id)).fromNow(),
|
time_ago: timeAgo,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ export default observer(({ channel }: Props) => {
|
|||||||
if (users.length >= 5) {
|
if (users.length >= 5) {
|
||||||
text = <Text id="app.main.channel.typing.several" />;
|
text = <Text id="app.main.channel.typing.several" />;
|
||||||
} else if (users.length > 1) {
|
} else if (users.length > 1) {
|
||||||
const userlist = [...users].map((x) => x!.username);
|
const userlist = [...users].map(
|
||||||
|
(x) => x!.display_name ?? x!.username,
|
||||||
|
);
|
||||||
const user = userlist.pop();
|
const user = userlist.pop();
|
||||||
|
|
||||||
text = (
|
text = (
|
||||||
@@ -92,7 +94,9 @@ export default observer(({ channel }: Props) => {
|
|||||||
text = (
|
text = (
|
||||||
<Text
|
<Text
|
||||||
id="app.main.channel.typing.single"
|
id="app.main.channel.typing.single"
|
||||||
fields={{ user: users[0]!.username }}
|
fields={{
|
||||||
|
user: users[0]!.display_name ?? users[0]!.username,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,11 @@ export default function Embed({ embed }: Props) {
|
|||||||
<a
|
<a
|
||||||
onMouseDown={(ev) =>
|
onMouseDown={(ev) =>
|
||||||
(ev.button === 0 || ev.button === 1) &&
|
(ev.button === 0 || ev.button === 1) &&
|
||||||
modalController.openLink(embed.url!)
|
modalController.openLink(
|
||||||
|
embed.url!,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
className={styles.title}>
|
className={styles.title}>
|
||||||
{embed.title}
|
{embed.title}
|
||||||
@@ -194,7 +198,8 @@ export default function Embed({ embed }: Props) {
|
|||||||
modalController.push({ type: "image_viewer", embed })
|
modalController.push({ type: "image_viewer", embed })
|
||||||
}
|
}
|
||||||
onMouseDown={(ev) =>
|
onMouseDown={(ev) =>
|
||||||
ev.button === 1 && modalController.openLink(embed.url)
|
ev.button === 1 &&
|
||||||
|
modalController.openLink(embed.url, undefined, true)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -22,12 +22,11 @@ enum Badges {
|
|||||||
const BadgesBase = styled.div`
|
const BadgesBase = styled.div`
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 4px;
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 32px;
|
width: 24px;
|
||||||
height: 32px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -103,7 +102,7 @@ export default function UserBadges({ badges, uid }: Props) {
|
|||||||
content={
|
content={
|
||||||
<Text id="app.special.popovers.user_profile.badges.responsible_disclosure" />
|
<Text id="app.special.popovers.user_profile.badges.responsible_disclosure" />
|
||||||
}>
|
}>
|
||||||
<Shield size={32} color="gray" />
|
<Shield size={24} color="gray" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
@@ -120,7 +119,7 @@ export default function UserBadges({ badges, uid }: Props) {
|
|||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open(
|
window.open(
|
||||||
"https://insrt.uk/donate",
|
"https://wiki.revolt.chat/notes/project/financial-support/",
|
||||||
"_blank",
|
"_blank",
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -29,9 +29,14 @@ const HeaderBase = styled.div`
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new-name {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
.username {
|
.username {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 16px;
|
font-size: 13px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,6 +55,9 @@ export default observer(({ user }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<Header topBorder palette="secondary">
|
<Header topBorder palette="secondary">
|
||||||
<HeaderBase>
|
<HeaderBase>
|
||||||
|
<div className="new-name">
|
||||||
|
{user.display_name ?? user.username}
|
||||||
|
</div>
|
||||||
<Localizer>
|
<Localizer>
|
||||||
<Tooltip content={<Text id="app.special.copy_username" />}>
|
<Tooltip content={<Text id="app.special.copy_username" />}>
|
||||||
<span
|
<span
|
||||||
@@ -57,7 +65,9 @@ export default observer(({ user }: Props) => {
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
modalController.writeText(user.username)
|
modalController.writeText(user.username)
|
||||||
}>
|
}>
|
||||||
@{user.username}
|
{user.username}
|
||||||
|
{"#"}
|
||||||
|
{user.discriminator}
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Localizer>
|
</Localizer>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import IconBase, { IconBaseProps } from "../IconBase";
|
|||||||
type VoiceStatus = "muted" | "deaf";
|
type VoiceStatus = "muted" | "deaf";
|
||||||
interface Props extends IconBaseProps<User> {
|
interface Props extends IconBaseProps<User> {
|
||||||
status?: boolean;
|
status?: boolean;
|
||||||
|
override?: string;
|
||||||
voice?: VoiceStatus;
|
voice?: VoiceStatus;
|
||||||
masquerade?: API.Masquerade;
|
masquerade?: API.Masquerade;
|
||||||
showServerIdentity?: boolean;
|
showServerIdentity?: boolean;
|
||||||
@@ -70,12 +71,15 @@ export default observer(
|
|||||||
showServerIdentity,
|
showServerIdentity,
|
||||||
masquerade,
|
masquerade,
|
||||||
innerRef,
|
innerRef,
|
||||||
|
override,
|
||||||
...svgProps
|
...svgProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
let { url } = props;
|
let { url } = props;
|
||||||
if (masquerade?.avatar) {
|
if (masquerade?.avatar) {
|
||||||
url = client.proxyFile(masquerade.avatar);
|
url = client.proxyFile(masquerade.avatar);
|
||||||
|
} else if (override) {
|
||||||
|
url = override;
|
||||||
} else if (!url) {
|
} else if (!url) {
|
||||||
let override;
|
let override;
|
||||||
if (target && showServerIdentity) {
|
if (target && showServerIdentity) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ type UsernameProps = Omit<
|
|||||||
masquerade?: API.Masquerade;
|
masquerade?: API.Masquerade;
|
||||||
showServerIdentity?: boolean | "both";
|
showServerIdentity?: boolean | "both";
|
||||||
|
|
||||||
|
override?: string;
|
||||||
innerRef?: Ref<any>;
|
innerRef?: Ref<any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,13 +65,18 @@ export const Username = observer(
|
|||||||
masquerade,
|
masquerade,
|
||||||
showServerIdentity,
|
showServerIdentity,
|
||||||
innerRef,
|
innerRef,
|
||||||
|
override,
|
||||||
...otherProps
|
...otherProps
|
||||||
}: UsernameProps) => {
|
}: UsernameProps) => {
|
||||||
let username = user?.username;
|
let username =
|
||||||
|
(user as unknown as { display_name: string })?.display_name ??
|
||||||
|
user?.username;
|
||||||
let color = masquerade?.colour;
|
let color = masquerade?.colour;
|
||||||
let timed_out: Date | undefined;
|
let timed_out: Date | undefined;
|
||||||
|
|
||||||
if (user && showServerIdentity) {
|
if (override) {
|
||||||
|
username = override;
|
||||||
|
} else if (user && showServerIdentity) {
|
||||||
const { server } = useParams<{ server?: string }>();
|
const { server } = useParams<{ server?: string }>();
|
||||||
if (server) {
|
if (server) {
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
@@ -146,6 +152,17 @@ export const Username = observer(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (override) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{el}
|
||||||
|
<BotBadge>
|
||||||
|
<Text id="app.main.channel.bot" />
|
||||||
|
</BotBadge>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import "katex/dist/katex.min.css";
|
import "katex/dist/katex.min.css";
|
||||||
import rehypeKatex from "rehype-katex";
|
|
||||||
import rehypePrism from "rehype-prism";
|
import rehypePrism from "rehype-prism";
|
||||||
import rehypeReact from "rehype-react";
|
import rehypeReact from "rehype-react";
|
||||||
import remarkBreaks from "remark-breaks";
|
import remarkBreaks from "remark-breaks";
|
||||||
@@ -14,6 +13,9 @@ import { createElement } from "preact";
|
|||||||
import { memo } from "preact/compat";
|
import { memo } from "preact/compat";
|
||||||
import { useLayoutEffect, useMemo, useState } from "preact/hooks";
|
import { useLayoutEffect, useMemo, useState } from "preact/hooks";
|
||||||
|
|
||||||
|
// @ts-expect-error no typings
|
||||||
|
import rehypeKatex from "@revoltchat/rehype-katex";
|
||||||
|
|
||||||
import { MarkdownProps } from "./Markdown";
|
import { MarkdownProps } from "./Markdown";
|
||||||
import { handlers } from "./hast";
|
import { handlers } from "./hast";
|
||||||
import { RenderCodeblock } from "./plugins/Codeblock";
|
import { RenderCodeblock } from "./plugins/Codeblock";
|
||||||
@@ -146,6 +148,7 @@ const render = unified()
|
|||||||
.use(rehypeKatex, {
|
.use(rehypeKatex, {
|
||||||
maxSize: 10,
|
maxSize: 10,
|
||||||
maxExpand: 0,
|
maxExpand: 0,
|
||||||
|
maxLength: 512,
|
||||||
trust: false,
|
trust: false,
|
||||||
strict: false,
|
strict: false,
|
||||||
output: "html",
|
output: "html",
|
||||||
@@ -182,7 +185,8 @@ const Container = styled.div<{ largeEmoji: boolean }>`
|
|||||||
/**
|
/**
|
||||||
* Regex for matching execessive recursion of blockquotes and lists
|
* Regex for matching execessive recursion of blockquotes and lists
|
||||||
*/
|
*/
|
||||||
const RE_RECURSIVE = /(^(?:[>*+-][^\S\r\n]*){5})(?:[>*+-][^\S\r\n]*)+(.*$)/gm;
|
const RE_RECURSIVE =
|
||||||
|
/(^(?:(?:[>*+-]|\d+\.)[^\S\r\n]*){5})(?:(?:[>*+-]|\d+\.)[^\S\r\n]*)+(.*$)/gm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regex for matching multi-line blockquotes
|
* Regex for matching multi-line blockquotes
|
||||||
@@ -244,9 +248,13 @@ export default memo(({ content, disallowBigEmoji }: MarkdownProps) => {
|
|||||||
const [Content, setContent] = useState<React.ReactElement>(null!);
|
const [Content, setContent] = useState<React.ReactElement>(null!);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
render
|
try {
|
||||||
.process(sanitisedContent)
|
render
|
||||||
.then((file) => setContent(file.result));
|
.process(sanitisedContent)
|
||||||
|
.then((file) => setContent(file.result));
|
||||||
|
} catch (err) {
|
||||||
|
setContent("Message failed to render." as never);
|
||||||
|
}
|
||||||
}, [sanitisedContent]);
|
}, [sanitisedContent]);
|
||||||
|
|
||||||
const largeEmoji = useMemo(
|
const largeEmoji = useMemo(
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ export function RenderAnchor({
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
onClick={(ev) =>
|
onClick={(ev) =>
|
||||||
modalController.openLink(href) && ev.preventDefault()
|
modalController.openLink(
|
||||||
|
href,
|
||||||
|
undefined,
|
||||||
|
ev.currentTarget.innerText !== href,
|
||||||
|
) && ev.preventDefault()
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default function AccountManagement() {
|
|||||||
<CategoryButton
|
<CategoryButton
|
||||||
icon={<Block size={24} color="var(--error)" />}
|
icon={<Block size={24} color="var(--error)" />}
|
||||||
description={
|
description={
|
||||||
"Disable your account. You won't be able to access it unless you contact support."
|
<Text id="app.settings.pages.account.manage.disable_description" />
|
||||||
}
|
}
|
||||||
action="chevron"
|
action="chevron"
|
||||||
onClick={callback("disable")}>
|
onClick={callback("disable")}>
|
||||||
@@ -49,7 +49,7 @@ export default function AccountManagement() {
|
|||||||
<CategoryButton
|
<CategoryButton
|
||||||
icon={<Trash size={24} color="var(--error)" />}
|
icon={<Trash size={24} color="var(--error)" />}
|
||||||
description={
|
description={
|
||||||
"Your account will be queued for deletion, a confirmation email will be sent."
|
<Text id="app.settings.pages.account.manage.delete_description" />
|
||||||
}
|
}
|
||||||
action="chevron"
|
action="chevron"
|
||||||
onClick={callback("delete")}>
|
onClick={callback("delete")}>
|
||||||
|
|||||||
@@ -37,7 +37,13 @@ export default observer(() => {
|
|||||||
|
|
||||||
{(
|
{(
|
||||||
[
|
[
|
||||||
["username", client.user!.username, At],
|
[
|
||||||
|
"username",
|
||||||
|
client.user!.username +
|
||||||
|
"#" +
|
||||||
|
client.user!.discriminator,
|
||||||
|
At,
|
||||||
|
],
|
||||||
["email", email, Envelope],
|
["email", email, Envelope],
|
||||||
["password", "•••••••••", Key],
|
["password", "•••••••••", Key],
|
||||||
] as const
|
] as const
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class ClientController {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
const error = takeError(err);
|
const error = takeError(err);
|
||||||
if (error === "Forbidden" || error === "Unauthorized") {
|
if (error === "Unauthorized") {
|
||||||
this.sessions.delete(user_id);
|
this.sessions.delete(user_id);
|
||||||
this.current = null;
|
this.current = null;
|
||||||
this.pickNextSession();
|
this.pickNextSession();
|
||||||
@@ -252,7 +252,7 @@ class ClientController {
|
|||||||
// Start client lifecycle
|
// Start client lifecycle
|
||||||
this.addSession(
|
this.addSession(
|
||||||
{
|
{
|
||||||
session,
|
session: session as never,
|
||||||
},
|
},
|
||||||
"new",
|
"new",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { API, Client } from "revolt.js";
|
|||||||
|
|
||||||
import { state } from "../../mobx/State";
|
import { state } from "../../mobx/State";
|
||||||
|
|
||||||
|
import { resetMemberSidebarFetched } from "../../components/navigation/right/MemberSidebar";
|
||||||
import { modalController } from "../modals/ModalController";
|
import { modalController } from "../modals/ModalController";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,6 +98,7 @@ export default class Session {
|
|||||||
* Called when the client signals it has received the Ready packet
|
* Called when the client signals it has received the Ready packet
|
||||||
*/
|
*/
|
||||||
private onReady() {
|
private onReady() {
|
||||||
|
resetMemberSidebarFetched();
|
||||||
this.emit({
|
this.emit({
|
||||||
action: "SUCCESS",
|
action: "SUCCESS",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ export function takeError(error: any): string {
|
|||||||
case 429:
|
case 429:
|
||||||
return "TooManyRequests";
|
return "TooManyRequests";
|
||||||
case 401:
|
case 401:
|
||||||
|
return "Unauthorized"
|
||||||
case 403:
|
case 403:
|
||||||
return "Unauthorized";
|
return "Forbidden";
|
||||||
default:
|
default:
|
||||||
return "UnknownError";
|
return "UnknownError";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { IconButton, Preloader } from "@revoltchat/ui";
|
|||||||
import { determineFileSize } from "../../../../lib/fileSize";
|
import { determineFileSize } from "../../../../lib/fileSize";
|
||||||
|
|
||||||
import { modalController } from "../../../modals/ModalController";
|
import { modalController } from "../../../modals/ModalController";
|
||||||
import { useClient } from "../../ClientController";
|
import { clientController, useClient } from "../../ClientController";
|
||||||
import { takeError } from "../error";
|
import { takeError } from "../error";
|
||||||
|
|
||||||
type BehaviourType =
|
type BehaviourType =
|
||||||
@@ -67,9 +67,16 @@ export async function uploadFile(
|
|||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", file);
|
formData.append("file", file);
|
||||||
|
|
||||||
|
const client = clientController.getActiveSession()?.client;
|
||||||
|
const sesToken =
|
||||||
|
typeof client?.session === "string"
|
||||||
|
? client.session
|
||||||
|
: client?.session?.token;
|
||||||
|
|
||||||
const res = await Axios.post(`${autumnURL}/${tag}`, formData, {
|
const res = await Axios.post(`${autumnURL}/${tag}`, formData, {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
|
"X-Session-Token": sesToken,
|
||||||
},
|
},
|
||||||
...config,
|
...config,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { history } from "../../context/history";
|
|||||||
import AddFriend from "./components/AddFriend";
|
import AddFriend from "./components/AddFriend";
|
||||||
import BanMember from "./components/BanMember";
|
import BanMember from "./components/BanMember";
|
||||||
import Changelog from "./components/Changelog";
|
import Changelog from "./components/Changelog";
|
||||||
|
import ChangelogUsernames from "./components/ChangelogUsernames";
|
||||||
import ChannelInfo from "./components/ChannelInfo";
|
import ChannelInfo from "./components/ChannelInfo";
|
||||||
import Clipboard from "./components/Clipboard";
|
import Clipboard from "./components/Clipboard";
|
||||||
import ConfirmLeave from "./components/ConfirmLeave";
|
import ConfirmLeave from "./components/ConfirmLeave";
|
||||||
@@ -39,6 +40,7 @@ import MFAEnableTOTP from "./components/MFAEnableTOTP";
|
|||||||
import MFAFlow from "./components/MFAFlow";
|
import MFAFlow from "./components/MFAFlow";
|
||||||
import MFARecovery from "./components/MFARecovery";
|
import MFARecovery from "./components/MFARecovery";
|
||||||
import ModifyAccount from "./components/ModifyAccount";
|
import ModifyAccount from "./components/ModifyAccount";
|
||||||
|
import ModifyDisplayname from "./components/ModifyDisplayname";
|
||||||
import OutOfDate from "./components/OutOfDate";
|
import OutOfDate from "./components/OutOfDate";
|
||||||
import PendingFriendRequests from "./components/PendingFriendRequests";
|
import PendingFriendRequests from "./components/PendingFriendRequests";
|
||||||
import ReportContent from "./components/Report";
|
import ReportContent from "./components/Report";
|
||||||
@@ -206,12 +208,25 @@ class ModalControllerExtended extends ModalController<Modal> {
|
|||||||
* Safely open external or internal link
|
* Safely open external or internal link
|
||||||
* @param href Raw URL
|
* @param href Raw URL
|
||||||
* @param trusted Whether we trust this link
|
* @param trusted Whether we trust this link
|
||||||
|
* @param mismatch Whether to always open link warning
|
||||||
* @returns Whether to cancel default event
|
* @returns Whether to cancel default event
|
||||||
*/
|
*/
|
||||||
openLink(href?: string, trusted?: boolean) {
|
openLink(href?: string, trusted?: boolean, mismatch?: boolean) {
|
||||||
const link = determineLink(href);
|
const link = determineLink(href);
|
||||||
const settings = getApplicationState().settings;
|
const settings = getApplicationState().settings;
|
||||||
|
|
||||||
|
if (mismatch) {
|
||||||
|
if (href) {
|
||||||
|
modalController.push({
|
||||||
|
type: "link_warning",
|
||||||
|
link: href,
|
||||||
|
callback: () => this.openLink(href, true) as true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
switch (link.type) {
|
switch (link.type) {
|
||||||
case "navigate": {
|
case "navigate": {
|
||||||
history.push(link.path);
|
history.push(link.path);
|
||||||
@@ -280,4 +295,7 @@ export const modalController = new ModalControllerExtended({
|
|||||||
user_profile: UserProfile,
|
user_profile: UserProfile,
|
||||||
report: ReportContent,
|
report: ReportContent,
|
||||||
report_success: ReportSuccess,
|
report_success: ReportSuccess,
|
||||||
|
modify_displayname: ModifyDisplayname,
|
||||||
|
changelog_usernames: ChangelogUsernames,
|
||||||
|
reset_bot_token: Confirmation
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default function AddFriend({ ...props }: ModalProps<"add_friend">) {
|
|||||||
data={{
|
data={{
|
||||||
username: {
|
username: {
|
||||||
field: "Username",
|
field: "Username",
|
||||||
|
placeholder: "username#1234",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
callback={({ username }) =>
|
callback={({ username }) =>
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ function RenderLog({ post }: { post: ChangelogPost }) {
|
|||||||
{post.content.map((entry) =>
|
{post.content.map((entry) =>
|
||||||
typeof entry === "string" ? (
|
typeof entry === "string" ? (
|
||||||
<Markdown content={entry} />
|
<Markdown content={entry} />
|
||||||
|
) : entry.type === "element" ? (
|
||||||
|
entry.element
|
||||||
) : (
|
) : (
|
||||||
<Image src={entry.src} shadow={entry.shadow} />
|
<Image src={entry.src} shadow={entry.shadow} />
|
||||||
),
|
),
|
||||||
|
|||||||
146
src/controllers/modals/components/ChangelogUsernames.tsx
Normal file
146
src/controllers/modals/components/ChangelogUsernames.tsx
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
import Lottie, { LottieRefCurrentProps } from "lottie-react";
|
||||||
|
|
||||||
|
import { useEffect, useRef } from "preact/hooks";
|
||||||
|
|
||||||
|
import { Button, Column, InputBox, Modal, Row } from "@revoltchat/ui";
|
||||||
|
|
||||||
|
import { useClient } from "../../client/ClientController";
|
||||||
|
import { modalController } from "../ModalController";
|
||||||
|
import { ModalProps } from "../types";
|
||||||
|
import usernameAnim from "./legacy/usernameUpdateLottie.json";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changelog: Username update
|
||||||
|
*/
|
||||||
|
export default function ChangelogUsernames({
|
||||||
|
onClose,
|
||||||
|
signal,
|
||||||
|
}: ModalProps<"changelog_usernames">) {
|
||||||
|
const client = useClient();
|
||||||
|
|
||||||
|
const lottieRef = useRef<LottieRefCurrentProps>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (lottieRef.current) {
|
||||||
|
const timer = setTimeout(() => lottieRef.current!.play(), 2500);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}
|
||||||
|
}, [lottieRef]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal onClose={onClose} signal={signal} transparent>
|
||||||
|
{
|
||||||
|
(
|
||||||
|
<Column gap="0">
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
background: "black",
|
||||||
|
borderStartStartRadius: "12px",
|
||||||
|
borderStartEndRadius: "12px",
|
||||||
|
display: "grid",
|
||||||
|
placeItems: "center",
|
||||||
|
padding: "1.5em",
|
||||||
|
}}>
|
||||||
|
<Lottie
|
||||||
|
lottieRef={lottieRef as never}
|
||||||
|
animationData={usernameAnim}
|
||||||
|
autoplay={false}
|
||||||
|
loop={false}
|
||||||
|
style={{ width: "240px" }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: "1em",
|
||||||
|
background: "var(--secondary-header)",
|
||||||
|
textAlign: "center",
|
||||||
|
}}>
|
||||||
|
<Column
|
||||||
|
gap="6px"
|
||||||
|
style={{
|
||||||
|
alignItems: "center",
|
||||||
|
}}>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
fontSize: "1.5em",
|
||||||
|
fontWeight: 700,
|
||||||
|
marginBottom: "12px",
|
||||||
|
}}>
|
||||||
|
Usernames are Changing
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
color: "var(--secondary-foreground)",
|
||||||
|
fontSize: "0.9em",
|
||||||
|
fontWeight: 500,
|
||||||
|
}}>
|
||||||
|
We've changed how usernames work on Revolt.
|
||||||
|
Now you can set a display name in addition
|
||||||
|
to a username with a number tag for easier
|
||||||
|
sharing.
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
color: "var(--secondary-foreground)",
|
||||||
|
fontSize: "0.9em",
|
||||||
|
fontWeight: 500,
|
||||||
|
}}>
|
||||||
|
Here's how your new username looks:
|
||||||
|
</span>
|
||||||
|
<InputBox
|
||||||
|
value={
|
||||||
|
client.user!.display_name ??
|
||||||
|
client.user!.username
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
maxWidth: "180px",
|
||||||
|
}}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<InputBox
|
||||||
|
value={
|
||||||
|
client.user.username +
|
||||||
|
"#" +
|
||||||
|
client.user.discriminator
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
maxWidth: "180px",
|
||||||
|
}}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<a
|
||||||
|
href="https://revolt.chat/posts/evolving-usernames"
|
||||||
|
target="_blank">
|
||||||
|
Read more about this change
|
||||||
|
</a>
|
||||||
|
</Column>
|
||||||
|
</div>
|
||||||
|
<Row
|
||||||
|
style={{
|
||||||
|
padding: "1em",
|
||||||
|
borderEndStartRadius: "12px",
|
||||||
|
borderEndEndRadius: "12px",
|
||||||
|
background: "var(--secondary-background)",
|
||||||
|
textAlign: "center",
|
||||||
|
justifyContent: "end",
|
||||||
|
}}>
|
||||||
|
<Button palette="plain" onClick={onClose}>
|
||||||
|
Skip for now
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
palette="accent"
|
||||||
|
onClick={() => {
|
||||||
|
modalController.openLink(
|
||||||
|
"/settings/profile",
|
||||||
|
);
|
||||||
|
onClose();
|
||||||
|
}}>
|
||||||
|
Edit Profile
|
||||||
|
</Button>
|
||||||
|
</Row>
|
||||||
|
</Column>
|
||||||
|
) as any
|
||||||
|
}
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ export default function Confirmation(
|
|||||||
| "delete_bot"
|
| "delete_bot"
|
||||||
| "block_user"
|
| "block_user"
|
||||||
| "unfriend_user"
|
| "unfriend_user"
|
||||||
|
| "reset_bot_token"
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -31,6 +32,7 @@ export default function Confirmation(
|
|||||||
delete_bot: ["confirm_delete", "delete"],
|
delete_bot: ["confirm_delete", "delete"],
|
||||||
unfriend_user: ["unfriend_user", "remove"],
|
unfriend_user: ["unfriend_user", "remove"],
|
||||||
block_user: ["block_user", "block"],
|
block_user: ["block_user", "block"],
|
||||||
|
reset_bot_token: ["reset_bot_token", "reset"],
|
||||||
};
|
};
|
||||||
|
|
||||||
const event = EVENTS[props.type];
|
const event = EVENTS[props.type];
|
||||||
@@ -88,6 +90,12 @@ export default function Confirmation(
|
|||||||
.bots.delete(props.target);
|
.bots.delete(props.target);
|
||||||
props.cb?.();
|
props.cb?.();
|
||||||
break;
|
break;
|
||||||
|
case "reset_bot_token":
|
||||||
|
clientController
|
||||||
|
.getAvailableClient()
|
||||||
|
.bots
|
||||||
|
.edit(props.target.id, { remove: ["Token"] })
|
||||||
|
.then(props.callback)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
submit={{
|
submit={{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { SubmitHandler, useForm } from "react-hook-form";
|
|||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
|
|
||||||
import { Category, Error, Modal } from "@revoltchat/ui";
|
import { Category, Error, InputBox, Modal, Tip } from "@revoltchat/ui";
|
||||||
|
|
||||||
import { noopTrue } from "../../../lib/js";
|
import { noopTrue } from "../../../lib/js";
|
||||||
|
|
||||||
@@ -120,14 +120,34 @@ export default function ModifyAccount({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{field === "username" && (
|
{field === "username" && (
|
||||||
<FormField
|
<div
|
||||||
type="username"
|
style={{
|
||||||
name="new_username"
|
display: "flex",
|
||||||
register={register}
|
alignItems: "end",
|
||||||
showOverline
|
gap: "8px",
|
||||||
error={errors.new_username?.message}
|
}}>
|
||||||
disabled={processing}
|
<div style={{ flexGrow: 1 }}>
|
||||||
/>
|
<FormField
|
||||||
|
type="username"
|
||||||
|
name="new_username"
|
||||||
|
register={register}
|
||||||
|
showOverline
|
||||||
|
error={errors.new_username?.message}
|
||||||
|
disabled={processing}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
flexShrink: 0,
|
||||||
|
width: "80px",
|
||||||
|
textAlign: "center",
|
||||||
|
}}>
|
||||||
|
<InputBox
|
||||||
|
disabled
|
||||||
|
value={"#" + client.user.discriminator}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<FormField
|
<FormField
|
||||||
type="current_password"
|
type="current_password"
|
||||||
@@ -141,11 +161,24 @@ export default function ModifyAccount({
|
|||||||
<Category compact>
|
<Category compact>
|
||||||
<Error
|
<Error
|
||||||
error={
|
error={
|
||||||
<Text id="app.special.modals.account.failed" />
|
<>
|
||||||
|
<Text id="app.special.modals.account.failed" />{" "}
|
||||||
|
<Text id={`error.${error}`}>{error}</Text>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Category>
|
</Category>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{field === "username" && (
|
||||||
|
<div style={{ marginTop: "8px" }}>
|
||||||
|
<Tip palette="warning">
|
||||||
|
Changing your username may change your number tag.
|
||||||
|
You can freely change the case of your username.
|
||||||
|
Your number tag may change at most once a day.
|
||||||
|
</Tip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</form>
|
</form>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|||||||
47
src/controllers/modals/components/ModifyDisplayname.tsx
Normal file
47
src/controllers/modals/components/ModifyDisplayname.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import { Text } from "preact-i18n";
|
||||||
|
|
||||||
|
import { ModalForm } from "@revoltchat/ui";
|
||||||
|
|
||||||
|
import { useClient } from "../../client/ClientController";
|
||||||
|
import { ModalProps } from "../types";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify display name modal
|
||||||
|
*/
|
||||||
|
export default function ModifyDisplayname({
|
||||||
|
...props
|
||||||
|
}: ModalProps<"modify_displayname">) {
|
||||||
|
const client = useClient();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm
|
||||||
|
{...props}
|
||||||
|
title="Update display name"
|
||||||
|
schema={{
|
||||||
|
display_name: "text",
|
||||||
|
}}
|
||||||
|
defaults={{
|
||||||
|
display_name: (
|
||||||
|
client.user as unknown as { display_name: string }
|
||||||
|
)?.display_name as string,
|
||||||
|
}}
|
||||||
|
data={{
|
||||||
|
display_name: {
|
||||||
|
field: "Display Name",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
callback={({ display_name }) =>
|
||||||
|
display_name && display_name !== client.user!.username
|
||||||
|
? client.users.edit({
|
||||||
|
display_name,
|
||||||
|
} as never)
|
||||||
|
: client.users.edit({
|
||||||
|
remove: ["DisplayName"],
|
||||||
|
} as never)
|
||||||
|
}
|
||||||
|
submit={{
|
||||||
|
children: <Text id="app.special.modals.actions.save" />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -41,6 +41,7 @@ const MessageContainer = styled.div`
|
|||||||
*/
|
*/
|
||||||
export default function ReportContent({
|
export default function ReportContent({
|
||||||
target,
|
target,
|
||||||
|
messageId,
|
||||||
...props
|
...props
|
||||||
}: ModalProps<"report">) {
|
}: ModalProps<"report">) {
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
@@ -124,6 +125,7 @@ export default function ReportContent({
|
|||||||
? "User"
|
? "User"
|
||||||
: "Server",
|
: "Server",
|
||||||
report_reason: reason as any,
|
report_reason: reason as any,
|
||||||
|
message_id: messageId,
|
||||||
},
|
},
|
||||||
additional_context,
|
additional_context,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { Text } from "preact-i18n";
|
|||||||
import { Column, H1, IconButton, Modal, Row } from "@revoltchat/ui";
|
import { Column, H1, IconButton, Modal, Row } from "@revoltchat/ui";
|
||||||
|
|
||||||
import Markdown from "../../../components/markdown/Markdown";
|
import Markdown from "../../../components/markdown/Markdown";
|
||||||
|
import { useClient } from "../../client/ClientController";
|
||||||
import { report } from "../../safety";
|
import { report } from "../../safety";
|
||||||
import { modalController } from "../ModalController";
|
import { modalController } from "../ModalController";
|
||||||
import { ModalProps } from "../types";
|
import { ModalProps } from "../types";
|
||||||
@@ -13,6 +14,49 @@ export default function ServerInfo({
|
|||||||
server,
|
server,
|
||||||
...props
|
...props
|
||||||
}: ModalProps<"server_info">) {
|
}: ModalProps<"server_info">) {
|
||||||
|
const client = useClient();
|
||||||
|
const isOwner = server.owner === client.user?._id;
|
||||||
|
|
||||||
|
const actions = [
|
||||||
|
{
|
||||||
|
onClick: () => {
|
||||||
|
modalController.push({
|
||||||
|
type: "server_identity",
|
||||||
|
member: server.member!,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
children: "Edit Identity",
|
||||||
|
palette: "primary",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!isOwner) {
|
||||||
|
actions.push({
|
||||||
|
onClick: () => {
|
||||||
|
modalController.push({
|
||||||
|
type: "leave_server",
|
||||||
|
target: server,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
children: "Leave Server",
|
||||||
|
palette: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
actions.push({
|
||||||
|
onClick: () => {
|
||||||
|
modalController.push({
|
||||||
|
type: "report",
|
||||||
|
target: server,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
children: <Text id="app.special.modals.actions.report" />,
|
||||||
|
palette: "error",
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
{...props}
|
{...props}
|
||||||
@@ -26,30 +70,7 @@ export default function ServerInfo({
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Row>
|
</Row>
|
||||||
}
|
}
|
||||||
actions={[
|
actions={actions}>
|
||||||
{
|
|
||||||
onClick: () => {
|
|
||||||
modalController.push({
|
|
||||||
type: "server_identity",
|
|
||||||
member: server.member!,
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
children: "Edit Identity",
|
|
||||||
palette: "primary",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
onClick: () => {
|
|
||||||
modalController.push({
|
|
||||||
type: "report",
|
|
||||||
target: server,
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
children: <Text id="app.special.modals.actions.report" />,
|
|
||||||
palette: "error",
|
|
||||||
},
|
|
||||||
]}>
|
|
||||||
<Markdown content={server.description!} />
|
<Markdown content={server.description!} />
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ export function OnboardingModal({
|
|||||||
error={error}
|
error={error}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<p>
|
||||||
|
You will be automatically assigned a number
|
||||||
|
tag which you can find from settings.
|
||||||
|
</p>
|
||||||
<Button palette="accent">
|
<Button palette="accent">
|
||||||
{"Looks good!"}
|
{"Looks good!"}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -46,13 +46,28 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.username {
|
.usernameDetail {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.displayname {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.username {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
width: fit-content;
|
||||||
|
color: var(--secondary-foreground);
|
||||||
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
color: var(--secondary-foreground);
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
display: inline !important;
|
display: inline !important;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
UserX,
|
UserX,
|
||||||
Group,
|
Group,
|
||||||
InfoCircle,
|
InfoCircle,
|
||||||
|
Flag,
|
||||||
} from "@styled-icons/boxicons-solid";
|
} from "@styled-icons/boxicons-solid";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Link, useHistory } from "react-router-dom";
|
import { Link, useHistory } from "react-router-dom";
|
||||||
@@ -163,16 +164,33 @@ export const UserProfile = observer(
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div className={styles.details}>
|
<div className={styles.details}>
|
||||||
<Localizer>
|
<div className={styles.usernameDetail}>
|
||||||
<span
|
<span
|
||||||
className={styles.username}
|
className={styles.displayname}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
modalController.writeText(user.username)
|
modalController.writeText(user.username)
|
||||||
}>
|
}>
|
||||||
{"@"}
|
{user.display_name ?? user.username}
|
||||||
{user.username}
|
|
||||||
</span>
|
</span>
|
||||||
</Localizer>
|
<span
|
||||||
|
className={styles.username}
|
||||||
|
onClick={() =>
|
||||||
|
modalController.writeText(
|
||||||
|
user.username +
|
||||||
|
"#" +
|
||||||
|
user.discriminator,
|
||||||
|
)
|
||||||
|
}>
|
||||||
|
<Localizer>
|
||||||
|
<Tooltip
|
||||||
|
content={
|
||||||
|
<Text id="app.special.copy_username" />
|
||||||
|
}>
|
||||||
|
{user.username}#{user.discriminator}
|
||||||
|
</Tooltip>
|
||||||
|
</Localizer>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
{user.status?.text && (
|
{user.status?.text && (
|
||||||
<span className={styles.status}>
|
<span className={styles.status}>
|
||||||
<UserStatus user={user} tooltip />
|
<UserStatus user={user} tooltip />
|
||||||
@@ -229,7 +247,40 @@ export const UserProfile = observer(
|
|||||||
<UserX size={28} />
|
<UserX size={28} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
{!user.bot && flags != 2 && flags != 4 && (
|
||||||
|
<Localizer>
|
||||||
|
<Tooltip
|
||||||
|
content={
|
||||||
|
<Text id="app.context_menu.report_user" />
|
||||||
|
}>
|
||||||
|
<IconButton
|
||||||
|
onClick={() =>
|
||||||
|
modalController.push({
|
||||||
|
type: "report",
|
||||||
|
target: user,
|
||||||
|
})
|
||||||
|
}>
|
||||||
|
<Flag size={28} />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
</Localizer>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{badges > 0 && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
marginInline: "1em",
|
||||||
|
padding: "0.5em",
|
||||||
|
background: "var(--primary-background)",
|
||||||
|
borderRadius: "8px",
|
||||||
|
width: "fit-content",
|
||||||
|
backgroundColor:
|
||||||
|
"rgba(var(--primary-header-rgb), max(var(--min-opacity), 0.65))",
|
||||||
|
backdropFilter: "blur(20px)",
|
||||||
|
}}>
|
||||||
|
<UserBadges badges={badges} uid={user._id} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={styles.tabs}>
|
<div className={styles.tabs}>
|
||||||
<div
|
<div
|
||||||
data-active={tab === "profile"}
|
data-active={tab === "profile"}
|
||||||
@@ -261,10 +312,7 @@ export const UserProfile = observer(
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
{tab === "profile" &&
|
{tab === "profile" &&
|
||||||
(profile?.content ||
|
(profile?.content || flags > 0 || user.bot ? (
|
||||||
badges > 0 ||
|
|
||||||
flags > 0 ||
|
|
||||||
user.bot ? (
|
|
||||||
<div>
|
<div>
|
||||||
{flags & 1 ? (
|
{flags & 1 ? (
|
||||||
/** ! FIXME: i18n this area */
|
/** ! FIXME: i18n this area */
|
||||||
@@ -314,17 +362,6 @@ export const UserProfile = observer(
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
{badges > 0 && (
|
|
||||||
<div className={styles.category}>
|
|
||||||
<Text id="app.special.popovers.user_profile.sub.badges" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{badges > 0 && (
|
|
||||||
<UserBadges
|
|
||||||
badges={badges}
|
|
||||||
uid={user._id}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{profile?.content && (
|
{profile?.content && (
|
||||||
<>
|
<>
|
||||||
<div className={styles.category}>
|
<div className={styles.category}>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -9,6 +9,7 @@ export type Modal = {
|
|||||||
| "create_group"
|
| "create_group"
|
||||||
| "create_server"
|
| "create_server"
|
||||||
| "custom_status"
|
| "custom_status"
|
||||||
|
| "modify_displayname"
|
||||||
| "add_friend";
|
| "add_friend";
|
||||||
}
|
}
|
||||||
| ({
|
| ({
|
||||||
@@ -40,6 +41,7 @@ export type Modal = {
|
|||||||
type: "changelog";
|
type: "changelog";
|
||||||
initial?: number;
|
initial?: number;
|
||||||
}
|
}
|
||||||
|
| { type: "changelog_usernames" }
|
||||||
| {
|
| {
|
||||||
type: "sign_out_sessions";
|
type: "sign_out_sessions";
|
||||||
client: Client;
|
client: Client;
|
||||||
@@ -182,11 +184,17 @@ export type Modal = {
|
|||||||
| {
|
| {
|
||||||
type: "report";
|
type: "report";
|
||||||
target: Server | User | Message;
|
target: Server | User | Message;
|
||||||
|
messageId?: string;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: "report_success";
|
type: "report_success";
|
||||||
user?: User;
|
user?: User;
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
type: "reset_bot_token";
|
||||||
|
target: { name: string, id: string },
|
||||||
|
callback: () => Promise<void>;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export type ModalProps<T extends Modal["type"]> = Modal & { type: T } & {
|
export type ModalProps<T extends Modal["type"]> = Modal & { type: T } & {
|
||||||
|
|||||||
@@ -2,32 +2,29 @@ import { ChevronRight, Trash } from "@styled-icons/boxicons-regular";
|
|||||||
import { Cog, UserVoice } from "@styled-icons/boxicons-solid";
|
import { Cog, UserVoice } from "@styled-icons/boxicons-solid";
|
||||||
import { isFirefox } from "react-device-detect";
|
import { isFirefox } from "react-device-detect";
|
||||||
import { useHistory } from "react-router-dom";
|
import { useHistory } from "react-router-dom";
|
||||||
import {
|
import { Channel, Message, Server, User, API, Permission, UserPermission, Member } from "revolt.js";
|
||||||
Channel,
|
|
||||||
Message,
|
|
||||||
Server,
|
|
||||||
User,
|
|
||||||
API,
|
|
||||||
Permission,
|
|
||||||
UserPermission,
|
|
||||||
Member,
|
|
||||||
} from "revolt.js";
|
|
||||||
|
|
||||||
import {
|
|
||||||
ContextMenuWithData,
|
|
||||||
MenuItem,
|
import { ContextMenuWithData, MenuItem, openContextMenu } from "preact-context-menu";
|
||||||
openContextMenu,
|
|
||||||
} from "preact-context-menu";
|
|
||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
|
|
||||||
import { IconButton, LineDivider } from "@revoltchat/ui";
|
|
||||||
|
|
||||||
|
import { Column, IconButton, LineDivider } from "@revoltchat/ui";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { useApplicationState } from "../mobx/State";
|
import { useApplicationState } from "../mobx/State";
|
||||||
import { QueuedMessage } from "../mobx/stores/MessageQueue";
|
import { QueuedMessage } from "../mobx/stores/MessageQueue";
|
||||||
import { NotificationState } from "../mobx/stores/NotificationOptions";
|
import { NotificationState } from "../mobx/stores/NotificationOptions";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import CMNotifications from "./contextmenu/CMNotifications";
|
import CMNotifications from "./contextmenu/CMNotifications";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import Tooltip from "../components/common/Tooltip";
|
import Tooltip from "../components/common/Tooltip";
|
||||||
import UserStatus from "../components/common/user/UserStatus";
|
import UserStatus from "../components/common/user/UserStatus";
|
||||||
import { useSession } from "../controllers/client/ClientController";
|
import { useSession } from "../controllers/client/ClientController";
|
||||||
@@ -36,6 +33,7 @@ import { modalController } from "../controllers/modals/ModalController";
|
|||||||
import { internalEmit } from "./eventEmitter";
|
import { internalEmit } from "./eventEmitter";
|
||||||
import { getRenderer } from "./renderer/Singleton";
|
import { getRenderer } from "./renderer/Singleton";
|
||||||
|
|
||||||
|
|
||||||
interface ContextMenuData {
|
interface ContextMenuData {
|
||||||
user?: string;
|
user?: string;
|
||||||
server?: string;
|
server?: string;
|
||||||
@@ -47,10 +45,13 @@ interface ContextMenuData {
|
|||||||
unread?: boolean;
|
unread?: boolean;
|
||||||
queued?: QueuedMessage;
|
queued?: QueuedMessage;
|
||||||
contextualChannel?: string;
|
contextualChannel?: string;
|
||||||
|
contextualMessage?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type Action =
|
type Action =
|
||||||
| { action: "copy_id"; id: string }
|
| { action: "copy_id"; id: string }
|
||||||
|
| { action: "admin"; id: string; type: "channel" | "message" | "user" }
|
||||||
|
| { action: "admin_system"; id: string }
|
||||||
| { action: "copy_message_link"; message: Message }
|
| { action: "copy_message_link"; message: Message }
|
||||||
| { action: "copy_selection" }
|
| { action: "copy_selection" }
|
||||||
| { action: "copy_text"; content: string }
|
| { action: "copy_text"; content: string }
|
||||||
@@ -112,7 +113,7 @@ type Action =
|
|||||||
key: string;
|
key: string;
|
||||||
state?: NotificationState;
|
state?: NotificationState;
|
||||||
}
|
}
|
||||||
| { action: "report"; target: User | Server | Message };
|
| { action: "report"; target: User | Server | Message; messageId?: string };
|
||||||
|
|
||||||
// ! FIXME: I dare someone to re-write this
|
// ! FIXME: I dare someone to re-write this
|
||||||
// Tip: This should just be split into separate context menus per logical area.
|
// Tip: This should just be split into separate context menus per logical area.
|
||||||
@@ -132,6 +133,18 @@ export default function ContextMenus() {
|
|||||||
case "copy_id":
|
case "copy_id":
|
||||||
modalController.writeText(data.id);
|
modalController.writeText(data.id);
|
||||||
break;
|
break;
|
||||||
|
case "admin":
|
||||||
|
window.open(
|
||||||
|
`https://admin.revolt.chat/panel/inspect/${data.type}/${data.id}`,
|
||||||
|
"_blank",
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "admin_system":
|
||||||
|
window.open(
|
||||||
|
`https://admin.revolt.chat/panel/inspect/user/${data.id}`,
|
||||||
|
"_blank",
|
||||||
|
);
|
||||||
|
break;
|
||||||
case "copy_message_link":
|
case "copy_message_link":
|
||||||
{
|
{
|
||||||
let pathname = `/channel/${data.message.channel_id}/${data.message._id}`;
|
let pathname = `/channel/${data.message.channel_id}/${data.message._id}`;
|
||||||
@@ -275,11 +288,7 @@ export default function ContextMenus() {
|
|||||||
window.open(
|
window.open(
|
||||||
// ! FIXME: do this from revolt.js
|
// ! FIXME: do this from revolt.js
|
||||||
client
|
client
|
||||||
.generateFileURL(data.attachment)
|
.generateFileURL(data.attachment),
|
||||||
?.replace(
|
|
||||||
"attachments",
|
|
||||||
"attachments/download",
|
|
||||||
),
|
|
||||||
isFirefox || window.native ? "_blank" : "_self",
|
isFirefox || window.native ? "_blank" : "_self",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -454,6 +463,7 @@ export default function ContextMenus() {
|
|||||||
modalController.push({
|
modalController.push({
|
||||||
type: "report",
|
type: "report",
|
||||||
target: data.target,
|
target: data.target,
|
||||||
|
messageId: data.messageId,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -478,6 +488,7 @@ export default function ContextMenus() {
|
|||||||
queued,
|
queued,
|
||||||
unread,
|
unread,
|
||||||
contextualChannel: cxid,
|
contextualChannel: cxid,
|
||||||
|
contextualMessage,
|
||||||
}: ContextMenuData) => {
|
}: ContextMenuData) => {
|
||||||
const elements: Children[] = [];
|
const elements: Children[] = [];
|
||||||
let lastDivider = false;
|
let lastDivider = false;
|
||||||
@@ -493,11 +504,17 @@ export default function ContextMenus() {
|
|||||||
elements.push(
|
elements.push(
|
||||||
<MenuItem data={action} disabled={disabled}>
|
<MenuItem data={action} disabled={disabled}>
|
||||||
<span style={{ color }}>
|
<span style={{ color }}>
|
||||||
<Text
|
{locale === "admin" ? (
|
||||||
id={`app.context_menu.${
|
"Open in Admin Panel"
|
||||||
locale ?? action.action
|
) : locale === "admin_system" ? (
|
||||||
}`}
|
"Open User in Admin Panel"
|
||||||
/>
|
) : (
|
||||||
|
<Text
|
||||||
|
id={`app.context_menu.${
|
||||||
|
locale ?? action.action
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
{tip && <div className="tip">{tip}</div>}
|
{tip && <div className="tip">{tip}</div>}
|
||||||
</MenuItem>,
|
</MenuItem>,
|
||||||
@@ -682,6 +699,7 @@ export default function ContextMenus() {
|
|||||||
{
|
{
|
||||||
action: "report",
|
action: "report",
|
||||||
target: user,
|
target: user,
|
||||||
|
messageId: contextualMessage,
|
||||||
},
|
},
|
||||||
"report_user",
|
"report_user",
|
||||||
undefined,
|
undefined,
|
||||||
@@ -1103,6 +1121,37 @@ export default function ContextMenus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!hideIDButton) {
|
if (!hideIDButton) {
|
||||||
|
if (state.experiments.isEnabled("admin_beta")) {
|
||||||
|
generateAction(
|
||||||
|
{
|
||||||
|
action: "admin",
|
||||||
|
id,
|
||||||
|
type: cid
|
||||||
|
? "channel"
|
||||||
|
: message
|
||||||
|
? "message"
|
||||||
|
: "user",
|
||||||
|
},
|
||||||
|
"admin",
|
||||||
|
);
|
||||||
|
|
||||||
|
switch (message?.system?.type) {
|
||||||
|
case "user_added":
|
||||||
|
case "user_remove":
|
||||||
|
case "user_joined":
|
||||||
|
case "user_left":
|
||||||
|
case "user_kicked":
|
||||||
|
case "user_banned":
|
||||||
|
generateAction(
|
||||||
|
{
|
||||||
|
action: "admin_system",
|
||||||
|
id: message.system.id,
|
||||||
|
},
|
||||||
|
"admin_system",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
generateAction(
|
generateAction(
|
||||||
{ action: "copy_id", id },
|
{ action: "copy_id", id },
|
||||||
cid
|
cid
|
||||||
@@ -1138,7 +1187,21 @@ export default function ContextMenus() {
|
|||||||
content={
|
content={
|
||||||
<Text id="app.special.copy_username" />
|
<Text id="app.special.copy_username" />
|
||||||
}>
|
}>
|
||||||
@{user.username}
|
<Column gap="0">
|
||||||
|
<span>
|
||||||
|
{user.display_name ??
|
||||||
|
user.username}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
fontSize: "0.8em",
|
||||||
|
}}>
|
||||||
|
{user.username}
|
||||||
|
{"#"}
|
||||||
|
{user.discriminator ??
|
||||||
|
"0000"}
|
||||||
|
</span>
|
||||||
|
</Column>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { action, makeAutoObservable, runInAction } from "mobx";
|
import { action, makeAutoObservable, runInAction } from "mobx";
|
||||||
|
|
||||||
import { latestChangelog } from "../../assets/changelogs";
|
import { changelogEntries, latestChangelog } from "../../assets/changelogs";
|
||||||
import { modalController } from "../../controllers/modals/ModalController";
|
import { modalController } from "../../controllers/modals/ModalController";
|
||||||
import Persistent from "../interfaces/Persistent";
|
import Persistent from "../interfaces/Persistent";
|
||||||
import Store from "../interfaces/Store";
|
import Store from "../interfaces/Store";
|
||||||
@@ -58,10 +58,21 @@ export default class Changelog implements Store, Persistent<Data>, Syncable {
|
|||||||
*/
|
*/
|
||||||
checkForUpdates() {
|
checkForUpdates() {
|
||||||
if (this.viewed < latestChangelog) {
|
if (this.viewed < latestChangelog) {
|
||||||
modalController.push({
|
const expires = new Date(+changelogEntries[latestChangelog].date);
|
||||||
type: "changelog",
|
expires.setDate(expires.getDate() + 7);
|
||||||
initial: latestChangelog,
|
|
||||||
});
|
if (+new Date() < +expires) {
|
||||||
|
if (latestChangelog === 3) {
|
||||||
|
modalController.push({
|
||||||
|
type: "changelog_usernames",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
modalController.push({
|
||||||
|
type: "changelog",
|
||||||
|
initial: latestChangelog,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.viewed = latestChangelog;
|
this.viewed = latestChangelog;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Store from "../interfaces/Store";
|
|||||||
/**
|
/**
|
||||||
* Union type of available experiments.
|
* Union type of available experiments.
|
||||||
*/
|
*/
|
||||||
export type Experiment = "dummy" | "offline_users" | "plugins" | "picker";
|
export type Experiment = "dummy" | "offline_users" | "plugins" | "admin_beta";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Currently active experiments.
|
* Currently active experiments.
|
||||||
@@ -19,7 +19,7 @@ export const AVAILABLE_EXPERIMENTS: Experiment[] = [
|
|||||||
"dummy",
|
"dummy",
|
||||||
"offline_users",
|
"offline_users",
|
||||||
"plugins",
|
"plugins",
|
||||||
"picker",
|
"admin_beta",
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,10 +42,10 @@ export const EXPERIMENTS: {
|
|||||||
description:
|
description:
|
||||||
"This will enable the experimental plugin API. Only touch this if you know what you're doing.",
|
"This will enable the experimental plugin API. Only touch this if you know what you're doing.",
|
||||||
},
|
},
|
||||||
picker: {
|
admin_beta: {
|
||||||
title: "Custom Emoji",
|
title: "Admin Panel Shortcuts",
|
||||||
description:
|
description:
|
||||||
"This will enable a work-in-progress emoji picker, custom emoji settings and a reaction picker.",
|
"Adds context menu entries to quickly jump to Revolt Admin Panel. This is intended for use by the team.",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const AppContainer = styled.div`
|
|||||||
background-position: center center !important;
|
background-position: center center !important;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StatusBar = styled.div`
|
export const StatusBar = styled.div`
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Hash } from "@styled-icons/boxicons-regular";
|
import { Hash } from "@styled-icons/boxicons-regular";
|
||||||
import { Ghost } from "@styled-icons/boxicons-solid";
|
import { Ghost } from "@styled-icons/boxicons-solid";
|
||||||
|
import dayjs from "dayjs";
|
||||||
import { reaction } from "mobx";
|
import { reaction } from "mobx";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Redirect, useParams } from "react-router-dom";
|
import { Redirect, useParams } from "react-router-dom";
|
||||||
@@ -163,6 +164,7 @@ const TextChannel = observer(({ channel }: { channel: ChannelI }) => {
|
|||||||
|
|
||||||
const checkUnread = () =>
|
const checkUnread = () =>
|
||||||
channel.unread &&
|
channel.unread &&
|
||||||
|
document.hasFocus() &&
|
||||||
channel.client.unreads!.markRead(
|
channel.client.unreads!.markRead(
|
||||||
channel._id,
|
channel._id,
|
||||||
channel.last_message_id!,
|
channel.last_message_id!,
|
||||||
@@ -176,6 +178,46 @@ const TextChannel = observer(({ channel }: { channel: ChannelI }) => {
|
|||||||
);
|
);
|
||||||
}, [channel]);
|
}, [channel]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let lastSubscribed: number | undefined;
|
||||||
|
function subscribe() {
|
||||||
|
if (document.hasFocus()) {
|
||||||
|
if (
|
||||||
|
!lastSubscribed ||
|
||||||
|
dayjs().subtract(10, "minutes").isAfter(lastSubscribed)
|
||||||
|
) {
|
||||||
|
lastSubscribed = +new Date();
|
||||||
|
channel.server?.subscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger logic every minute
|
||||||
|
const subTimer = setInterval(subscribe, 60e3);
|
||||||
|
subscribe();
|
||||||
|
|
||||||
|
function onFocus() {
|
||||||
|
// Mark channel as read if it's unread
|
||||||
|
if (channel.unread) {
|
||||||
|
channel.client.unreads!.markRead(
|
||||||
|
channel._id,
|
||||||
|
channel.last_message_id!,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subscribe to channel if expired
|
||||||
|
subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventListener("focus", onFocus);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
removeEventListener("focus", onFocus);
|
||||||
|
clearInterval(subTimer);
|
||||||
|
};
|
||||||
|
}, [channel]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AgeGate
|
<AgeGate
|
||||||
type="channel"
|
type="channel"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const VoiceBase = styled.div`
|
|||||||
margin-top: 48px;
|
margin-top: 48px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background: var(--secondary-background);
|
background: var(--secondary-background);
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
flex: 1 0;
|
flex: 1 0;
|
||||||
@@ -54,8 +55,6 @@ const VoiceBase = styled.div`
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
overflow-y: scroll;
|
|
||||||
|
|
||||||
.participants {
|
.participants {
|
||||||
margin: 40px 20px;
|
margin: 40px 20px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export const Friend = observer(({ user }: Props) => {
|
|||||||
})}>
|
})}>
|
||||||
<UserIcon target={user} size={36} status />
|
<UserIcon target={user} size={36} status />
|
||||||
<div className={styles.name}>
|
<div className={styles.name}>
|
||||||
<span>{user.username}</span>
|
<span>{user.display_name ?? user.username}</span>
|
||||||
{subtext && <span className={styles.subtext}>{subtext}</span>}
|
{subtext && <span className={styles.subtext}>{subtext}</span>}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.actions}>{actions}</div>
|
<div className={styles.actions}>{actions}</div>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 6em;
|
||||||
div {
|
div {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@@ -54,3 +54,4 @@
|
|||||||
[data-light="true"] .home svg {
|
[data-light="true"] .home svg {
|
||||||
filter: invert(100%);
|
filter: invert(100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default observer(() => {
|
|||||||
state.settings.set("appearance:seasonal", !seasonalTheme);
|
state.settings.set("appearance:seasonal", !seasonalTheme);
|
||||||
|
|
||||||
const isDecember = !isTouchscreenDevice && new Date().getMonth() === 11;
|
const isDecember = !isTouchscreenDevice && new Date().getMonth() === 11;
|
||||||
const isOctober = !isTouchscreenDevice && new Date().getMonth() === 9
|
const isOctober = !isTouchscreenDevice && new Date().getMonth() === 9;
|
||||||
const snowflakes = useMemo(() => {
|
const snowflakes = useMemo(() => {
|
||||||
const flakes: string[] = [];
|
const flakes: string[] = [];
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ export default observer(() => {
|
|||||||
</CategoryButton>
|
</CategoryButton>
|
||||||
</Link>
|
</Link>
|
||||||
<a
|
<a
|
||||||
href="https://insrt.uk/donate"
|
href="https://wiki.revolt.chat/notes/project/financial-support/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer">
|
rel="noreferrer">
|
||||||
<CategoryButton
|
<CategoryButton
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import { Twitter, Github, Mastodon } from "@styled-icons/boxicons-logos";
|
import { Twitter, Github, Mastodon } from "@styled-icons/boxicons-logos";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
import { Route, Switch } from "react-router-dom";
|
import { Link, Route, Switch } from "react-router-dom";
|
||||||
|
|
||||||
import styles from "./Login.module.scss";
|
import styles from "./Login.module.scss";
|
||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
|
|
||||||
import { useApplicationState } from "../../mobx/State";
|
import { useApplicationState } from "../../mobx/State";
|
||||||
|
|
||||||
import LocaleSelector from "../../components/common/LocaleSelector";
|
|
||||||
import wideSVG from "/assets/wide.svg";
|
import wideSVG from "/assets/wide.svg";
|
||||||
|
|
||||||
|
import LocaleSelector from "../../components/common/LocaleSelector";
|
||||||
import { Titlebar } from "../../components/native/Titlebar";
|
import { Titlebar } from "../../components/native/Titlebar";
|
||||||
|
import { useSystemAlert } from "../../updateWorker";
|
||||||
|
import { StatusBar } from "../RevoltApp";
|
||||||
import { FormCreate } from "./forms/FormCreate";
|
import { FormCreate } from "./forms/FormCreate";
|
||||||
import { FormLogin } from "./forms/FormLogin";
|
import { FormLogin } from "./forms/FormLogin";
|
||||||
import { FormReset, FormSendReset } from "./forms/FormReset";
|
import { FormReset, FormSendReset } from "./forms/FormReset";
|
||||||
@@ -21,11 +23,31 @@ export default observer(() => {
|
|||||||
const state = useApplicationState();
|
const state = useApplicationState();
|
||||||
const theme = state.settings.theme;
|
const theme = state.settings.theme;
|
||||||
|
|
||||||
|
const alert = useSystemAlert();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{window.isNative && !window.native.getConfig().frame && (
|
{window.isNative && !window.native.getConfig().frame && (
|
||||||
<Titlebar overlay />
|
<Titlebar overlay />
|
||||||
)}
|
)}
|
||||||
|
{alert && (
|
||||||
|
<StatusBar>
|
||||||
|
<div className="title">{alert.text}</div>
|
||||||
|
<div className="actions">
|
||||||
|
{alert.actions?.map((action) =>
|
||||||
|
action.type === "internal" ? null : action.type ===
|
||||||
|
"external" ? (
|
||||||
|
<a
|
||||||
|
href={action.href}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
<div className="button">{action.text}</div>{" "}
|
||||||
|
</a>
|
||||||
|
) : null,
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</StatusBar>
|
||||||
|
)}
|
||||||
<div className={styles.login}>
|
<div className={styles.login}>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<meta
|
<meta
|
||||||
@@ -77,17 +99,20 @@ export default observer(() => {
|
|||||||
<div className={styles.socials}>
|
<div className={styles.socials}>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/revoltchat"
|
href="https://github.com/revoltchat"
|
||||||
target="_blank" rel="noreferrer">
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
<Github size={24} />
|
<Github size={24} />
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://twitter.com/revoltchat"
|
href="https://twitter.com/revoltchat"
|
||||||
target="_blank" rel="noreferrer">
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
<Twitter size={24} />
|
<Twitter size={24} />
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://mastodon.social/@revoltchat"
|
href="https://mastodon.social/@revoltchat"
|
||||||
target="_blank" rel="noreferrer">
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
<Mastodon size={24} />
|
<Mastodon size={24} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,7 +141,8 @@ export default observer(() => {
|
|||||||
<a
|
<a
|
||||||
className={styles.attribution}
|
className={styles.attribution}
|
||||||
href="https://unsplash.com/@fakurian"
|
href="https://unsplash.com/@fakurian"
|
||||||
target="_blank" rel="noreferrer">
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
<Text id="general.image_by" /> ‎@fakurian ‏·
|
<Text id="general.image_by" /> ‎@fakurian ‏·
|
||||||
unsplash.com
|
unsplash.com
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -202,11 +202,9 @@ export const Form = observer(({ page, callback }: Props) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{error && (
|
{error && (
|
||||||
<Category>
|
<p style={{ fontSize: "0.8em", color: "var(--error)" }}>
|
||||||
<I18nError error={error}>
|
<Text id={`error.${error}`} children={error} />
|
||||||
<Text id={`login.error.${page}`} />
|
</p>
|
||||||
</I18nError>
|
|
||||||
</Category>
|
|
||||||
)}
|
)}
|
||||||
<Button>
|
<Button>
|
||||||
<Text
|
<Text
|
||||||
@@ -259,7 +257,7 @@ export const Form = observer(({ page, callback }: Props) => {
|
|||||||
<span>
|
<span>
|
||||||
<Text id="login.unofficial_instance" />{" "}
|
<Text id="login.unofficial_instance" />{" "}
|
||||||
<a
|
<a
|
||||||
href="https://developers.revolt.chat/faq/instances#what-is-a-third-party-instance"
|
href="https://developers.revolt.chat/faq.html"
|
||||||
style={{ color: "var(--accent)" }}
|
style={{ color: "var(--accent)" }}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer">
|
rel="noreferrer">
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export default observer(() => {
|
|||||||
id: "emojis",
|
id: "emojis",
|
||||||
icon: <HappyBeaming size={20} />,
|
icon: <HappyBeaming size={20} />,
|
||||||
title: <Text id="app.settings.server_pages.emojis.title" />,
|
title: <Text id="app.settings.server_pages.emojis.title" />,
|
||||||
hidden: !state.experiments.isEnabled("picker"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: (
|
category: (
|
||||||
|
|||||||
@@ -80,10 +80,15 @@ const AccountHeader = styled.div`
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
|
|
||||||
> span {
|
.new {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +281,7 @@ export default observer(() => {
|
|||||||
</ButtonItem>
|
</ButtonItem>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://insrt.uk/donate"
|
href="https://wiki.revolt.chat/notes/project/financial-support/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer">
|
rel="noreferrer">
|
||||||
<ButtonItem className={styles.donate} compact>
|
<ButtonItem className={styles.donate} compact>
|
||||||
@@ -336,7 +341,15 @@ export default observer(() => {
|
|||||||
onClick={() => openContextMenu("Status")}
|
onClick={() => openContextMenu("Status")}
|
||||||
/>
|
/>
|
||||||
<div className="details">
|
<div className="details">
|
||||||
<Username user={client.user!} prefixAt />
|
<span className="new">
|
||||||
|
{client.user.display_name ??
|
||||||
|
client.user.username}
|
||||||
|
</span>
|
||||||
|
<span className="full">
|
||||||
|
{client.user.username}
|
||||||
|
{"#"}
|
||||||
|
{client.user.discriminator}
|
||||||
|
</span>
|
||||||
<UserStatus user={client.user!} />
|
<UserStatus user={client.user!} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -94,6 +94,33 @@ export function Audio() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.audio}>
|
<div className={styles.audio}>
|
||||||
|
<Tip palette="warning">
|
||||||
|
<span>
|
||||||
|
We are currently{" "}
|
||||||
|
<a
|
||||||
|
style={{ color: "inherit", fontWeight: "600" }}
|
||||||
|
href="https://github.com/revoltchat/frontend/issues/14"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
rebuilding the client
|
||||||
|
</a>{" "}
|
||||||
|
and{" "}
|
||||||
|
<a
|
||||||
|
style={{ color: "inherit", fontWeight: "600" }}
|
||||||
|
href="https://trello.com/c/Ay6KdiOV/1-voice-overhaul-and-video-calling"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
the voice server
|
||||||
|
</a>{" "}
|
||||||
|
from scratch.
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
The old voice should work in most cases, but it may
|
||||||
|
inexplicably not connect in some scenarios and / or
|
||||||
|
exhibit weird behaviour.
|
||||||
|
</span>
|
||||||
|
</Tip>
|
||||||
|
|
||||||
{!permission && (
|
{!permission && (
|
||||||
<Tip palette="error">
|
<Tip palette="error">
|
||||||
<Text id="app.settings.pages.audio.tip_grant_permission" />
|
<Text id="app.settings.pages.audio.tip_grant_permission" />
|
||||||
|
|||||||
@@ -5,60 +5,76 @@ import { Link } from "react-router-dom";
|
|||||||
import styles from "./Panes.module.scss";
|
import styles from "./Panes.module.scss";
|
||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
|
|
||||||
import { CategoryButton } from "@revoltchat/ui";
|
import { CategoryButton, Column, Tip } from "@revoltchat/ui";
|
||||||
|
|
||||||
export function Feedback() {
|
export function Feedback() {
|
||||||
return (
|
return (
|
||||||
<div className={styles.feedback}>
|
<Column>
|
||||||
<a
|
<Tip palette="warning">
|
||||||
href="https://github.com/revoltchat/revolt/discussions"
|
<span>
|
||||||
target="_blank"
|
We are currently rebuilding the client from scratch. You can{" "}
|
||||||
rel="noreferrer">
|
<a
|
||||||
<CategoryButton
|
style={{ color: "inherit", fontWeight: "600" }}
|
||||||
action="external"
|
href="https://github.com/revoltchat/frontend/issues/14"
|
||||||
icon={<Github size={24} />}
|
target="_blank"
|
||||||
description={
|
rel="noreferrer">
|
||||||
<Text id="app.settings.pages.feedback.suggest_desc" />
|
view our progress here
|
||||||
}>
|
</a>
|
||||||
<Text id="app.settings.pages.feedback.suggest" />
|
; in the meantime, we are only accepting and fixing critical
|
||||||
</CategoryButton>
|
bugs with the current client.
|
||||||
</a>
|
</span>
|
||||||
<a
|
</Tip>
|
||||||
href="https://github.com/revoltchat/revite/issues/new/choose"
|
<div className={styles.feedback}>
|
||||||
target="_blank"
|
<a
|
||||||
rel="noreferrer">
|
href="https://github.com/revoltchat/revolt/discussions"
|
||||||
<CategoryButton
|
target="_blank"
|
||||||
action="external"
|
rel="noreferrer">
|
||||||
icon={<ListOl size={24} />}
|
|
||||||
description={
|
|
||||||
<Text id="app.settings.pages.feedback.issue_desc" />
|
|
||||||
}>
|
|
||||||
<Text id="app.settings.pages.feedback.issue" />
|
|
||||||
</CategoryButton>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://github.com/orgs/revoltchat/projects/3"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer">
|
|
||||||
<CategoryButton
|
|
||||||
action="external"
|
|
||||||
icon={<BugAlt size={24} />}
|
|
||||||
description={
|
|
||||||
<Text id="app.settings.pages.feedback.bug_desc" />
|
|
||||||
}>
|
|
||||||
<Text id="app.settings.pages.feedback.bug" />
|
|
||||||
</CategoryButton>
|
|
||||||
</a>
|
|
||||||
<Link to="/invite/Testers">
|
|
||||||
<a>
|
|
||||||
<CategoryButton
|
<CategoryButton
|
||||||
action="chevron"
|
action="external"
|
||||||
icon={<Group size={24} />}
|
icon={<Github size={24} />}
|
||||||
description="You can report issues and discuss improvements with us directly here.">
|
description={
|
||||||
{"Join the Revolt Lounge"}
|
<Text id="app.settings.pages.feedback.suggest_desc" />
|
||||||
|
}>
|
||||||
|
<Text id="app.settings.pages.feedback.suggest" />
|
||||||
</CategoryButton>
|
</CategoryButton>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
<a
|
||||||
</div>
|
href="https://github.com/revoltchat/revite/issues/new/choose"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
<CategoryButton
|
||||||
|
action="external"
|
||||||
|
icon={<ListOl size={24} />}
|
||||||
|
description={
|
||||||
|
<Text id="app.settings.pages.feedback.issue_desc" />
|
||||||
|
}>
|
||||||
|
<Text id="app.settings.pages.feedback.issue" />
|
||||||
|
</CategoryButton>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://github.com/orgs/revoltchat/projects/3"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
<CategoryButton
|
||||||
|
action="external"
|
||||||
|
icon={<BugAlt size={24} />}
|
||||||
|
description={
|
||||||
|
<Text id="app.settings.pages.feedback.bug_desc" />
|
||||||
|
}>
|
||||||
|
<Text id="app.settings.pages.feedback.bug" />
|
||||||
|
</CategoryButton>
|
||||||
|
</a>
|
||||||
|
<Link to="/invite/Testers">
|
||||||
|
<a>
|
||||||
|
<CategoryButton
|
||||||
|
action="chevron"
|
||||||
|
icon={<Group size={24} />}
|
||||||
|
description="You can report issues and discuss improvements with us directly here.">
|
||||||
|
{"Join the Revolt Lounge"}
|
||||||
|
</CategoryButton>
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</Column>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import { modalController } from "../../../controllers/modals/ModalController";
|
|||||||
|
|
||||||
interface Data {
|
interface Data {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
token: string;
|
||||||
username: string;
|
username: string;
|
||||||
public: boolean;
|
public: boolean;
|
||||||
interactions_url?: string;
|
interactions_url?: string;
|
||||||
@@ -74,6 +75,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
const [user, setUser] = useState<User>(client.users.get(bot._id)!);
|
const [user, setUser] = useState<User>(client.users.get(bot._id)!);
|
||||||
const [data, setData] = useState<Data>({
|
const [data, setData] = useState<Data>({
|
||||||
_id: bot._id,
|
_id: bot._id,
|
||||||
|
token: bot.token,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
public: bot.public,
|
public: bot.public,
|
||||||
interactions_url: bot.interactions_url as any,
|
interactions_url: bot.interactions_url as any,
|
||||||
@@ -94,7 +96,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
const refreshProfile = useCallback(() => {
|
const refreshProfile = useCallback(() => {
|
||||||
client.api
|
client.api
|
||||||
.get(`/users/${bot._id as ""}/profile`, undefined, {
|
.get(`/users/${bot._id as ""}/profile`, undefined, {
|
||||||
headers: { "x-bot-token": bot.token },
|
headers: { "x-bot-token": data.token },
|
||||||
})
|
})
|
||||||
.then((profile) => setProfile(profile ?? {}));
|
.then((profile) => setProfile(profile ?? {}));
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
@@ -149,7 +151,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
"/users/@me",
|
"/users/@me",
|
||||||
avatar ? { avatar } : { remove: ["Avatar"] },
|
avatar ? { avatar } : { remove: ["Avatar"] },
|
||||||
{
|
{
|
||||||
headers: { "x-bot-token": bot.token },
|
headers: { "x-bot-token": data.token },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
? { profile: { background } }
|
? { profile: { background } }
|
||||||
: { remove: ["ProfileBackground"] },
|
: { remove: ["ProfileBackground"] },
|
||||||
{
|
{
|
||||||
headers: { "x-bot-token": bot.token },
|
headers: { "x-bot-token": data.token },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -184,7 +186,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
"/users/@me",
|
"/users/@me",
|
||||||
content ? { profile: { content } } : { remove: ["ProfileContent"] },
|
content ? { profile: { content } } : { remove: ["ProfileContent"] },
|
||||||
{
|
{
|
||||||
headers: { "x-bot-token": bot.token },
|
headers: { "x-bot-token": data.token },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -312,6 +314,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
if (editMode) {
|
if (editMode) {
|
||||||
setData({
|
setData({
|
||||||
_id: bot._id,
|
_id: bot._id,
|
||||||
|
token: data.token,
|
||||||
username: user!.username,
|
username: user!.username,
|
||||||
public: bot.public,
|
public: bot.public,
|
||||||
interactions_url: bot.interactions_url as any,
|
interactions_url: bot.interactions_url as any,
|
||||||
@@ -334,7 +337,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
<CategoryButton
|
<CategoryButton
|
||||||
account
|
account
|
||||||
icon={<Key size={24} />}
|
icon={<Key size={24} />}
|
||||||
onClick={() => modalController.writeText(bot.token)}
|
onClick={() => modalController.writeText(data.token)}
|
||||||
description={
|
description={
|
||||||
<>
|
<>
|
||||||
{"••••• "}
|
{"••••• "}
|
||||||
@@ -344,7 +347,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
ev,
|
ev,
|
||||||
modalController.push({
|
modalController.push({
|
||||||
type: "show_token",
|
type: "show_token",
|
||||||
token: bot.token,
|
token: data.token,
|
||||||
name: user!.username,
|
name: user!.username,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@@ -490,6 +493,25 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
|||||||
}>
|
}>
|
||||||
<Text id="app.settings.pages.bots.add" />
|
<Text id="app.settings.pages.bots.add" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
palette="error"
|
||||||
|
onClick={ async () => {
|
||||||
|
modalController.push({
|
||||||
|
type: "reset_bot_token",
|
||||||
|
target: { name: user.username, id: bot._id },
|
||||||
|
callback: async () => {
|
||||||
|
const updatedBot = await client.bots.fetch(bot._id);
|
||||||
|
setData({
|
||||||
|
...data,
|
||||||
|
token: updatedBot.bot.token
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
<Text id="app.settings.pages.bots.reset_token" />
|
||||||
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export function Native() {
|
|||||||
title="Enable Discord status"
|
title="Enable Discord status"
|
||||||
description="Rep Revolt on your Discord status."
|
description="Rep Revolt on your Discord status."
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
{/* <Checkbox
|
||||||
value={config.build === "nightly"}
|
value={config.build === "nightly"}
|
||||||
onChange={(nightly) => {
|
onChange={(nightly) => {
|
||||||
const build = nightly ? "nightly" : "stable";
|
const build = nightly ? "nightly" : "stable";
|
||||||
@@ -79,7 +79,7 @@ export function Native() {
|
|||||||
}}
|
}}
|
||||||
title="Revolt Nightly"
|
title="Revolt Nightly"
|
||||||
description="Use the beta branch of Revolt."
|
description="Use the beta branch of Revolt."
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
<h3>Titlebar</h3>
|
<h3>Titlebar</h3>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -144,7 +144,7 @@ export function Native() {
|
|||||||
</Button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
<h3 style={{ marginTop: "4em" }}>Local Development Mode</h3>
|
<h3 style={{ marginTop: "4em" }}>Local Development Mode</h3>
|
||||||
{config.build === "dev" ? (
|
{/*config.build === "dev" ? (
|
||||||
<>
|
<>
|
||||||
<h5>Development mode is currently on.</h5>
|
<h5>Development mode is currently on.</h5>
|
||||||
<Button
|
<Button
|
||||||
@@ -197,7 +197,7 @@ export function Native() {
|
|||||||
</Button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)*/}
|
||||||
<hr />
|
<hr />
|
||||||
<CategoryButton
|
<CategoryButton
|
||||||
icon={<img src={RLogo} draggable={false} />}
|
icon={<img src={RLogo} draggable={false} />}
|
||||||
|
|||||||
@@ -694,3 +694,23 @@
|
|||||||
section {
|
section {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.titleNew {
|
||||||
|
display: flex;
|
||||||
|
margin: 15px 0;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
font-weight: 700;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--secondary-foreground);
|
||||||
|
|
||||||
|
.new {
|
||||||
|
font-size: 10px;
|
||||||
|
background: var(--accent);
|
||||||
|
padding: 3px 5px;
|
||||||
|
border-radius: 20px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Markdown } from "@styled-icons/boxicons-logos";
|
import { Markdown } from "@styled-icons/boxicons-logos";
|
||||||
|
import { UserCircle } from "@styled-icons/boxicons-solid";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { useHistory } from "react-router-dom";
|
import { useHistory } from "react-router-dom";
|
||||||
import { API } from "revolt.js";
|
import { API } from "revolt.js";
|
||||||
@@ -7,7 +8,7 @@ import styles from "./Panes.module.scss";
|
|||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
import { useCallback, useContext, useEffect, useState } from "preact/hooks";
|
import { useCallback, useContext, useEffect, useState } from "preact/hooks";
|
||||||
|
|
||||||
import { Button, LineDivider, Tip } from "@revoltchat/ui";
|
import { Button, LineDivider, Tip, CategoryButton } from "@revoltchat/ui";
|
||||||
|
|
||||||
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
|
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
|
||||||
import { useTranslation } from "../../../lib/i18n";
|
import { useTranslation } from "../../../lib/i18n";
|
||||||
@@ -17,6 +18,7 @@ import AutoComplete, {
|
|||||||
} from "../../../components/common/AutoComplete";
|
} from "../../../components/common/AutoComplete";
|
||||||
import { useSession } from "../../../controllers/client/ClientController";
|
import { useSession } from "../../../controllers/client/ClientController";
|
||||||
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
|
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
|
||||||
|
import { modalController } from "../../../controllers/modals/ModalController";
|
||||||
import { UserProfile } from "../../../controllers/modals/components/legacy/UserProfile";
|
import { UserProfile } from "../../../controllers/modals/components/legacy/UserProfile";
|
||||||
|
|
||||||
export const Profile = observer(() => {
|
export const Profile = observer(() => {
|
||||||
@@ -77,6 +79,19 @@ export const Profile = observer(() => {
|
|||||||
{...({} as any)}
|
{...({} as any)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles.titleNew}>
|
||||||
|
Display Name
|
||||||
|
<div className={styles.new}>NEW</div>
|
||||||
|
</div>
|
||||||
|
<CategoryButton
|
||||||
|
onClick={() =>
|
||||||
|
modalController.push({ type: "modify_displayname" })
|
||||||
|
}
|
||||||
|
icon={<UserCircle size={24} />}
|
||||||
|
action="chevron"
|
||||||
|
description={"Change your display name to whatever you like"}>
|
||||||
|
Display Name
|
||||||
|
</CategoryButton>
|
||||||
{/*<h3>Badges</h3>
|
{/*<h3>Badges</h3>
|
||||||
<div className={styles.badgePicker}>
|
<div className={styles.badgePicker}>
|
||||||
<div className={styles.overlay} />
|
<div className={styles.overlay} />
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ dayjs.extend(relativeTime);
|
|||||||
export function Sessions() {
|
export function Sessions() {
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
const deviceId =
|
const deviceId =
|
||||||
typeof client.session === "object" ? client.session._id : undefined;
|
typeof client.session === "object"
|
||||||
|
? (client.session as unknown as { _id: string })._id
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const [sessions, setSessions] = useState<API.SessionInfo[] | undefined>(
|
const [sessions, setSessions] = useState<API.SessionInfo[] | undefined>(
|
||||||
undefined,
|
undefined,
|
||||||
|
|||||||
@@ -369,7 +369,9 @@ function ListElement({
|
|||||||
<KanbanList last={false} key={category.id}>
|
<KanbanList last={false} key={category.id}>
|
||||||
<div className="inner">
|
<div className="inner">
|
||||||
<Row>
|
<Row>
|
||||||
<KanbanListHeader {...provided.dragHandleProps}>
|
<KanbanListHeader
|
||||||
|
{...provided.dragHandleProps}
|
||||||
|
onClick={startEditing}>
|
||||||
{editing !== undefined ? (
|
{editing !== undefined ? (
|
||||||
<input
|
<input
|
||||||
value={editing}
|
value={editing}
|
||||||
@@ -384,7 +386,7 @@ function ListElement({
|
|||||||
id={category.id}
|
id={category.id}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span onClick={startEditing}>
|
<span>
|
||||||
{category.title}
|
{category.title}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import styled from "styled-components";
|
|||||||
|
|
||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
|
|
||||||
import { Button, Column, Row, Stacked } from "@revoltchat/ui";
|
import { Button, Column, Row, Stacked, Tip } from "@revoltchat/ui";
|
||||||
|
|
||||||
import UserShort from "../../../components/common/user/UserShort";
|
import UserShort from "../../../components/common/user/UserShort";
|
||||||
import { EmojiUploader } from "../../../components/settings/customisation/EmojiUploader";
|
import { EmojiUploader } from "../../../components/settings/customisation/EmojiUploader";
|
||||||
@@ -33,6 +33,22 @@ export const Emojis = observer(({ server }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Column>
|
||||||
|
<Tip palette="warning">
|
||||||
|
<span>
|
||||||
|
This UI was never finished and will be polished in the{" "}
|
||||||
|
<a
|
||||||
|
style={{ color: "inherit", fontWeight: "600" }}
|
||||||
|
href="https://github.com/revoltchat/frontend/issues/14"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer">
|
||||||
|
new client
|
||||||
|
</a>
|
||||||
|
.<br />
|
||||||
|
<br />
|
||||||
|
Also please note that emoji names must be lowercase
|
||||||
|
alphanumeric!
|
||||||
|
</span>
|
||||||
|
</Tip>
|
||||||
{server.havePermission("ManageCustomisation") && (
|
{server.havePermission("ManageCustomisation") && (
|
||||||
<EmojiUploader server={server} />
|
<EmojiUploader server={server} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -103,10 +103,43 @@ export const Members = ({ server }: Props) => {
|
|||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
server
|
function fetch() {
|
||||||
.fetchMembers()
|
server
|
||||||
.then((data) => data.members)
|
.fetchMembers()
|
||||||
.then(setData);
|
.then((data) => data.members)
|
||||||
|
.then(setData);
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch();
|
||||||
|
|
||||||
|
// Members may be invalidated if we stop receiving events
|
||||||
|
// This is not very accurate, this should be tracked within
|
||||||
|
// revolt.js so we know the true validity.
|
||||||
|
let valid = true,
|
||||||
|
invalidationTimer: number;
|
||||||
|
|
||||||
|
function waitToInvalidate() {
|
||||||
|
invalidationTimer = setTimeout(() => {
|
||||||
|
valid = false;
|
||||||
|
}, 15 * 60e3) as never; // 15 minutes
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelInvalidation() {
|
||||||
|
if (!valid) {
|
||||||
|
fetch();
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(invalidationTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventListener("blur", waitToInvalidate);
|
||||||
|
addEventListener("focus", cancelInvalidation);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
removeEventListener("blur", waitToInvalidate);
|
||||||
|
removeEventListener("focus", cancelInvalidation);
|
||||||
|
};
|
||||||
}, [server, setData]);
|
}, [server, setData]);
|
||||||
|
|
||||||
const members = useMemo(
|
const members = useMemo(
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export function useSystemAlert() {
|
|||||||
*/
|
*/
|
||||||
async function checkVersion() {
|
async function checkVersion() {
|
||||||
const { version, poll_rate, alert } = (await fetch(
|
const { version, poll_rate, alert } = (await fetch(
|
||||||
"https://api.revolt.chat/release",
|
"https://health.revolt.chat/api/health",
|
||||||
).then((res) => res.json())) as {
|
).then((res) => res.json())) as {
|
||||||
version: string;
|
version: string;
|
||||||
poll_rate?: number;
|
poll_rate?: number;
|
||||||
@@ -111,7 +111,10 @@ async function checkVersion() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.env.VITE_API_URL === "https://api.revolt.chat") {
|
if (
|
||||||
|
import.meta.env.VITE_API_URL === "https://api.revolt.chat" ||
|
||||||
|
import.meta.env.VITE_API_URL === "https://app.revolt.chat/api"
|
||||||
|
) {
|
||||||
// Check for critical updates hourly
|
// Check for critical updates hourly
|
||||||
schedule();
|
schedule();
|
||||||
checkVersion();
|
checkVersion();
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
|
"jsxImportSource": "preact",
|
||||||
"jsxFactory": "h",
|
"jsxFactory": "h",
|
||||||
"jsxFragmentFactory": "Fragment",
|
"jsxFragmentFactory": "Fragment",
|
||||||
"types": ["vite-plugin-pwa/client"],
|
"types": ["vite-plugin-pwa/client"],
|
||||||
|
|||||||
159
yarn.lock
159
yarn.lock
@@ -2299,6 +2299,20 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@revoltchat/rehype-katex@npm:6.0.3-patch.1":
|
||||||
|
version: 6.0.3-patch.1
|
||||||
|
resolution: "@revoltchat/rehype-katex@npm:6.0.3-patch.1"
|
||||||
|
dependencies:
|
||||||
|
"@types/hast": ^2.0.0
|
||||||
|
"@types/katex": ^0.14.0
|
||||||
|
hast-util-from-html-isomorphic: ^1.0.0
|
||||||
|
hast-util-to-text: ^3.1.0
|
||||||
|
katex: ^0.16.7
|
||||||
|
unist-util-visit: ^4.0.0
|
||||||
|
checksum: 1b7e57ddafa300e96396a5f5d64dad947c201b514562b1d581ac1a683252bc074fcb620fb271c136dd8b84c069dad23cd98ef0b01585be426bb2ce3f5dde004f
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@revoltchat/ui@portal:external/components::locator=client%40workspace%3A.":
|
"@revoltchat/ui@portal:external/components::locator=client%40workspace%3A.":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@revoltchat/ui@portal:external/components::locator=client%40workspace%3A."
|
resolution: "@revoltchat/ui@portal:external/components::locator=client%40workspace%3A."
|
||||||
@@ -2627,6 +2641,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@types/katex@npm:^0.14.0":
|
||||||
|
version: 0.14.0
|
||||||
|
resolution: "@types/katex@npm:0.14.0"
|
||||||
|
checksum: 330e0d0337ba48c87f5b793965fbad673653789bf6e50dfe8d726a7b0cbefd37195055e31503aae629814aa79447e4f23a4b87ad1ac565c0d9a9d9978836f39b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@types/lodash.defaultsdeep@npm:^4.6.6":
|
"@types/lodash.defaultsdeep@npm:^4.6.6":
|
||||||
version: 4.6.6
|
version: 4.6.6
|
||||||
resolution: "@types/lodash.defaultsdeep@npm:4.6.6"
|
resolution: "@types/lodash.defaultsdeep@npm:4.6.6"
|
||||||
@@ -3688,6 +3709,7 @@ __metadata:
|
|||||||
"@hcaptcha/react-hcaptcha": ^1.4.4
|
"@hcaptcha/react-hcaptcha": ^1.4.4
|
||||||
"@insertish/vite-plugin-babel-macros": ^1.0.5
|
"@insertish/vite-plugin-babel-macros": ^1.0.5
|
||||||
"@preact/preset-vite": ^2.0.0
|
"@preact/preset-vite": ^2.0.0
|
||||||
|
"@revoltchat/rehype-katex": 6.0.3-patch.1
|
||||||
"@revoltchat/ui": ^1.0.77
|
"@revoltchat/ui": ^1.0.77
|
||||||
"@rollup/plugin-replace": ^2.4.2
|
"@rollup/plugin-replace": ^2.4.2
|
||||||
"@styled-icons/boxicons-logos": ^10.38.0
|
"@styled-icons/boxicons-logos": ^10.38.0
|
||||||
@@ -3732,6 +3754,7 @@ __metadata:
|
|||||||
lodash.defaultsdeep: ^4.6.1
|
lodash.defaultsdeep: ^4.6.1
|
||||||
lodash.isequal: ^4.5.0
|
lodash.isequal: ^4.5.0
|
||||||
long: ^5.2.0
|
long: ^5.2.0
|
||||||
|
lottie-react: ^2.4.0
|
||||||
mdast-util-to-hast: ^12.1.2
|
mdast-util-to-hast: ^12.1.2
|
||||||
mediasoup-client: "npm:@insertish/mediasoup-client@3.6.36-esnext"
|
mediasoup-client: "npm:@insertish/mediasoup-client@3.6.36-esnext"
|
||||||
mobx: ^6.6.0
|
mobx: ^6.6.0
|
||||||
@@ -3750,7 +3773,6 @@ __metadata:
|
|||||||
react-router-dom: ^5.2.0
|
react-router-dom: ^5.2.0
|
||||||
react-scroll: ^1.8.2
|
react-scroll: ^1.8.2
|
||||||
react-virtuoso: ^2.12.0
|
react-virtuoso: ^2.12.0
|
||||||
rehype-katex: ^6.0.2
|
|
||||||
rehype-prism: ^2.1.3
|
rehype-prism: ^2.1.3
|
||||||
rehype-react: ^7.1.1
|
rehype-react: ^7.1.1
|
||||||
remark-breaks: ^3.0.2
|
remark-breaks: ^3.0.2
|
||||||
@@ -3875,7 +3897,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"commander@npm:^8.0.0":
|
"commander@npm:^8.0.0, commander@npm:^8.3.0":
|
||||||
version: 8.3.0
|
version: 8.3.0
|
||||||
resolution: "commander@npm:8.3.0"
|
resolution: "commander@npm:8.3.0"
|
||||||
checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0
|
checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0
|
||||||
@@ -4232,6 +4254,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"entities@npm:^4.4.0":
|
||||||
|
version: 4.5.0
|
||||||
|
resolution: "entities@npm:4.5.0"
|
||||||
|
checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"env-paths@npm:^2.2.0":
|
"env-paths@npm:^2.2.0":
|
||||||
version: 2.2.1
|
version: 2.2.1
|
||||||
resolution: "env-paths@npm:2.2.1"
|
resolution: "env-paths@npm:2.2.1"
|
||||||
@@ -5324,6 +5353,41 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"hast-util-from-dom@npm:^4.0.0":
|
||||||
|
version: 4.2.0
|
||||||
|
resolution: "hast-util-from-dom@npm:4.2.0"
|
||||||
|
dependencies:
|
||||||
|
hastscript: ^7.0.0
|
||||||
|
web-namespaces: ^2.0.0
|
||||||
|
checksum: 0eac72cfb2bad20cf70ad978332be8c746dba27576fea3c3b123d7d1a52a8e10a88a25622b60f45255994163845e3f784fcd7c013b1301f2df4b81e3d0b1b973
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"hast-util-from-html-isomorphic@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "hast-util-from-html-isomorphic@npm:1.0.0"
|
||||||
|
dependencies:
|
||||||
|
"@types/hast": ^2.0.0
|
||||||
|
hast-util-from-dom: ^4.0.0
|
||||||
|
hast-util-from-html: ^1.0.0
|
||||||
|
unist-util-remove-position: ^4.0.0
|
||||||
|
checksum: a72786d6757a1a38d76cf74ba86fecfaf0690d465dcae477bfa7199ec03d364ba964f658331406ee7e62e912186df6d4ff38fc3ad050e0e3d8bc33a653df060d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"hast-util-from-html@npm:^1.0.0":
|
||||||
|
version: 1.0.2
|
||||||
|
resolution: "hast-util-from-html@npm:1.0.2"
|
||||||
|
dependencies:
|
||||||
|
"@types/hast": ^2.0.0
|
||||||
|
hast-util-from-parse5: ^7.0.0
|
||||||
|
parse5: ^7.0.0
|
||||||
|
vfile: ^5.0.0
|
||||||
|
vfile-message: ^3.0.0
|
||||||
|
checksum: 81cbda7dfa4c02fcb4e4359a48e25ebee7bef133dc607c2c036c53df27efacdfa22313a86398391ef22b31decda98c7110f1b441c5a48f419514be6b5d4b5603
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"hast-util-from-parse5@npm:^7.0.0":
|
"hast-util-from-parse5@npm:^7.0.0":
|
||||||
version: 7.1.0
|
version: 7.1.0
|
||||||
resolution: "hast-util-from-parse5@npm:7.1.0"
|
resolution: "hast-util-from-parse5@npm:7.1.0"
|
||||||
@@ -5341,12 +5405,12 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"hast-util-is-element@npm:^2.0.0":
|
"hast-util-is-element@npm:^2.0.0":
|
||||||
version: 2.1.2
|
version: 2.1.3
|
||||||
resolution: "hast-util-is-element@npm:2.1.2"
|
resolution: "hast-util-is-element@npm:2.1.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/hast": ^2.0.0
|
"@types/hast": ^2.0.0
|
||||||
"@types/unist": ^2.0.0
|
"@types/unist": ^2.0.0
|
||||||
checksum: c5fe9f7cde3775d4cbe19a9a55631a80b7a4ea0131fc2e3d097ebe228a35f09b9219f64b788b7a9cf819e6dcb6d1fc7830fd2f10ad536649e436e8c83da41e00
|
checksum: 9d988f6839a50566a895a3dd19222e6ab1591243f6a3c36bba835b7e9339a2845f1ff1c583425afd602de1a57a76c5bae8a6dc0ab1d6e5d1e252b422cdeadbb7
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -5360,13 +5424,14 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"hast-util-to-text@npm:^3.1.0":
|
"hast-util-to-text@npm:^3.1.0":
|
||||||
version: 3.1.1
|
version: 3.1.2
|
||||||
resolution: "hast-util-to-text@npm:3.1.1"
|
resolution: "hast-util-to-text@npm:3.1.2"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/hast": ^2.0.0
|
"@types/hast": ^2.0.0
|
||||||
|
"@types/unist": ^2.0.0
|
||||||
hast-util-is-element: ^2.0.0
|
hast-util-is-element: ^2.0.0
|
||||||
unist-util-find-after: ^4.0.0
|
unist-util-find-after: ^4.0.0
|
||||||
checksum: 2312a818c8ec7b02307b04175357e5a7a9918f48624d05366668ba60918734ca62b0ee21006a2a448e0e5a198654cd1fa4ba8c813702b465cb487e2320db523a
|
checksum: d17cf3344c1d584ddd811cbb78d25b6c9819e62c8edb9643b53be38083fd978a6fa9a5bf6e6cd7b5ea48d30d9edc2859acae40b8bb89e166bebcda6017d4703d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -6004,14 +6069,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"katex@npm:^0.15.0":
|
"katex@npm:^0.16.7":
|
||||||
version: 0.15.6
|
version: 0.16.7
|
||||||
resolution: "katex@npm:0.15.6"
|
resolution: "katex@npm:0.16.7"
|
||||||
dependencies:
|
dependencies:
|
||||||
commander: ^8.0.0
|
commander: ^8.3.0
|
||||||
bin:
|
bin:
|
||||||
katex: cli.js
|
katex: cli.js
|
||||||
checksum: 2da808bbd1d3be27715006cd86767dd3fcce3e317fb3bbd64d407328d2d90de17b5d83062b2cfd0e0d0de32e340efbac214862bc96892a5d1492462e553728d4
|
checksum: 6c3f61e28820ecba074a149d17be6d731d8a950cdd7826851e16f2b0f3627c4119acd8c6e4fb86950063c4e99a6e478720ea6cca3dc82e59bbca81001ee00b70
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -6205,6 +6270,25 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"lottie-react@npm:^2.4.0":
|
||||||
|
version: 2.4.0
|
||||||
|
resolution: "lottie-react@npm:2.4.0"
|
||||||
|
dependencies:
|
||||||
|
lottie-web: ^5.10.2
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
checksum: e9ea4a89be90a29bde4a83956f76a80d1f8031882f18ea38ef5271d2aafd8e68348ae6297f185ed85b149ca4896fe33aee7faf9780b88a1b289b8e146f477448
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"lottie-web@npm:^5.10.2":
|
||||||
|
version: 5.12.0
|
||||||
|
resolution: "lottie-web@npm:5.12.0"
|
||||||
|
checksum: 77c35be880e484d1a766f21f789ede7c7be59e957579580a18c2dfec08c4812c03e1d652e453166c31fd80556446d6b857fb490d901e34154105532519bc5ef5
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"lru-cache@npm:^6.0.0":
|
"lru-cache@npm:^6.0.0":
|
||||||
version: 6.0.0
|
version: 6.0.0
|
||||||
resolution: "lru-cache@npm:6.0.0"
|
resolution: "lru-cache@npm:6.0.0"
|
||||||
@@ -7268,6 +7352,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"parse5@npm:^7.0.0":
|
||||||
|
version: 7.1.2
|
||||||
|
resolution: "parse5@npm:7.1.2"
|
||||||
|
dependencies:
|
||||||
|
entities: ^4.4.0
|
||||||
|
checksum: 59465dd05eb4c5ec87b76173d1c596e152a10e290b7abcda1aecf0f33be49646ea74840c69af975d7887543ea45564801736356c568d6b5e71792fd0f4055713
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"path-exists@npm:^4.0.0":
|
"path-exists@npm:^4.0.0":
|
||||||
version: 4.0.0
|
version: 4.0.0
|
||||||
resolution: "path-exists@npm:4.0.0"
|
resolution: "path-exists@npm:4.0.0"
|
||||||
@@ -7794,23 +7887,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"rehype-katex@npm:^6.0.2":
|
"rehype-parse@npm:^7 || ^ 8":
|
||||||
version: 6.0.2
|
|
||||||
resolution: "rehype-katex@npm:6.0.2"
|
|
||||||
dependencies:
|
|
||||||
"@types/hast": ^2.0.0
|
|
||||||
"@types/katex": ^0.11.0
|
|
||||||
hast-util-to-text: ^3.1.0
|
|
||||||
katex: ^0.15.0
|
|
||||||
rehype-parse: ^8.0.0
|
|
||||||
unified: ^10.0.0
|
|
||||||
unist-util-remove-position: ^4.0.0
|
|
||||||
unist-util-visit: ^4.0.0
|
|
||||||
checksum: ac8b3486441697b8e22cb7ebf6ec58e06d190240f45b128fe60422b9eb887599f38406581e6e3356af967eb1d45d631b0c09387f060190641f402f56c78fa771
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"rehype-parse@npm:^7 || ^ 8, rehype-parse@npm:^8.0.0":
|
|
||||||
version: 8.0.4
|
version: 8.0.4
|
||||||
resolution: "rehype-parse@npm:8.0.4"
|
resolution: "rehype-parse@npm:8.0.4"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -8016,14 +8093,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"revolt-api@npm:0.5.8":
|
"revolt-api@npm:0.6.0":
|
||||||
version: 0.5.8
|
version: 0.6.0
|
||||||
resolution: "revolt-api@npm:0.5.8"
|
resolution: "revolt-api@npm:0.6.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@insertish/oapi": 0.1.18
|
"@insertish/oapi": 0.1.18
|
||||||
axios: ^0.26.1
|
axios: ^0.26.1
|
||||||
lodash.defaultsdeep: ^4.6.1
|
lodash.defaultsdeep: ^4.6.1
|
||||||
checksum: d488fa87774e4e9d0b3136779c555cbed257d2b76a298b17dca346cc3909f81e84aa516c10a415a7c20cd31990d540ade5489f69e06f69e14ba4974a26aa145e
|
checksum: 94865aa1aee5b05682ffe4e40a0fe431809f879437399943fc429d078160a5fe24686011b43639d6fae88e9a7a43fbe4bb9beb9bbe1bb3070965636f0ec051fd
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -8040,7 +8117,7 @@ __metadata:
|
|||||||
lodash.isequal: ^4.5.0
|
lodash.isequal: ^4.5.0
|
||||||
long: ^5.2.0
|
long: ^5.2.0
|
||||||
mobx: ^6.3.2
|
mobx: ^6.3.2
|
||||||
revolt-api: 0.5.8
|
revolt-api: 0.6.0
|
||||||
ulid: ^2.3.0
|
ulid: ^2.3.0
|
||||||
ws: ^8.2.2
|
ws: ^8.2.2
|
||||||
languageName: node
|
languageName: node
|
||||||
@@ -9120,12 +9197,12 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"unist-util-find-after@npm:^4.0.0":
|
"unist-util-find-after@npm:^4.0.0":
|
||||||
version: 4.0.0
|
version: 4.0.1
|
||||||
resolution: "unist-util-find-after@npm:4.0.0"
|
resolution: "unist-util-find-after@npm:4.0.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist": ^2.0.0
|
"@types/unist": ^2.0.0
|
||||||
unist-util-is: ^5.0.0
|
unist-util-is: ^5.0.0
|
||||||
checksum: 8381ef0bad18a0b1fa1c7ee47f94a2578ab6bf572eb126a1f179526b9dca47584fc070976f2d83bbe381161fa33b9164a894d0279a30ec83e65433356d43df57
|
checksum: bed7e7a1a87539bea0b33ddc9ce8e2f3fdd4a7c87e143a848ed5bbb4cf9c563ade7ecf80b3ee5a38f9ad9e6af29cdb8cdde9001eea92542cbb14784f5add7019
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -9160,12 +9237,12 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"unist-util-remove-position@npm:^4.0.0":
|
"unist-util-remove-position@npm:^4.0.0":
|
||||||
version: 4.0.1
|
version: 4.0.2
|
||||||
resolution: "unist-util-remove-position@npm:4.0.1"
|
resolution: "unist-util-remove-position@npm:4.0.2"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist": ^2.0.0
|
"@types/unist": ^2.0.0
|
||||||
unist-util-visit: ^4.0.0
|
unist-util-visit: ^4.0.0
|
||||||
checksum: 7d2808662ac65f2b2f615822b78060419f738fb3b074b10cec77c596ea966b8f5c47553d2d322822a5975c49d2b21cdd64c198ae9fb02a9d54d1afa6342cdd6a
|
checksum: 989831da913d09a82a99ed9b47b78471b6409bde95942cde47e09da54b7736516f17e3c7e026af468684c1efcec5fb52df363381b2f9dc7fd96ce791c5a2fa4a
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user