diff --git a/.env b/.env index 6fb48752..fd3eeb19 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -VITE_API_URL=http://local.revolt.chat:8000 +VITE_API_URL=https://api.revolt.chat VITE_THEMES_URL=https://themes.revolt.chat diff --git a/package.json b/package.json index 6dd08ca3..43679d30 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "react-scroll": "^1.8.2", "react-virtualized-auto-sizer": "^1.0.5", "react-virtuoso": "^1.10.4", - "revolt.js": "6.0.0-rc.15", + "revolt.js": "6.0.0-rc.19", "rimraf": "^3.0.2", "sass": "^1.35.1", "shade-blend-color": "^1.0.0", diff --git a/src/components/common/IconBase.tsx b/src/components/common/IconBase.tsx index 6a836153..43b1db01 100644 --- a/src/components/common/IconBase.tsx +++ b/src/components/common/IconBase.tsx @@ -1,5 +1,5 @@ import { API } from "revolt.js"; -import { Nullable } from "revolt.js/esm/util/null"; +import { Nullable } from "revolt.js"; import styled, { css } from "styled-components/macro"; export interface IconBaseProps { diff --git a/src/components/navigation/items/ConnectionStatus.tsx b/src/components/navigation/items/ConnectionStatus.tsx index 90b6db86..de0d42b7 100644 --- a/src/components/navigation/items/ConnectionStatus.tsx +++ b/src/components/navigation/items/ConnectionStatus.tsx @@ -23,7 +23,9 @@ export default function ConnectionStatus() { return (
- client.websocket.connect()}>Reconnect + client.websocket.connect()}> + +
); } else if (status === ClientStatus.CONNECTING) { diff --git a/src/context/Theme.tsx b/src/context/Theme.tsx index 5062667f..9e2aab70 100644 --- a/src/context/Theme.tsx +++ b/src/context/Theme.tsx @@ -1,3 +1,4 @@ +// @ts-expect-error No typings. import rgba from "color-rgba"; import { observer } from "mobx-react-lite"; import { Helmet } from "react-helmet"; diff --git a/src/context/revoltjs/SyncManager.tsx b/src/context/revoltjs/SyncManager.tsx index 42ef3eb3..3137cad9 100644 --- a/src/context/revoltjs/SyncManager.tsx +++ b/src/context/revoltjs/SyncManager.tsx @@ -1,7 +1,7 @@ /** * This file monitors changes to settings and syncs them to the server. */ -import { ClientboundNotification } from "revolt.js/esm/websocket/notifications"; +import { ClientboundNotification } from "revolt.js"; import { useEffect } from "preact/hooks"; diff --git a/src/lib/ContextMenus.tsx b/src/lib/ContextMenus.tsx index 82dae56b..8ab1497d 100644 --- a/src/lib/ContextMenus.tsx +++ b/src/lib/ContextMenus.tsx @@ -13,7 +13,7 @@ import { import { Cog, UserVoice } from "@styled-icons/boxicons-solid"; import { useHistory } from "react-router-dom"; import { Channel, Message, Server, User, API } from "revolt.js"; -import { Permission, UserPermission } from "revolt.js/esm/api/permissions"; +import { Permission, UserPermission } from "revolt.js"; import { ContextMenuWithData, diff --git a/src/lib/contextmenu/CMNotifications.tsx b/src/lib/contextmenu/CMNotifications.tsx index 9d84c566..0c235ede 100644 --- a/src/lib/contextmenu/CMNotifications.tsx +++ b/src/lib/contextmenu/CMNotifications.tsx @@ -9,8 +9,8 @@ import { LeftArrowAlt, } from "@styled-icons/boxicons-regular"; import { observer } from "mobx-react-lite"; -import { Channel } from "revolt.js/esm/maps/Channels"; -import { Server } from "revolt.js/esm/maps/Servers"; +import { Channel } from "revolt.js"; +import { Server } from "revolt.js"; import { ContextMenuWithData, MenuItem } from "preact-context-menu"; import { Text } from "preact-i18n"; diff --git a/src/lib/renderer/Singleton.ts b/src/lib/renderer/Singleton.ts index 135bd964..f30b9ec0 100644 --- a/src/lib/renderer/Singleton.ts +++ b/src/lib/renderer/Singleton.ts @@ -1,8 +1,8 @@ /* eslint-disable react-hooks/rules-of-hooks */ import { action, makeAutoObservable } from "mobx"; -import { Channel } from "revolt.js/esm/maps/Channels"; -import { Message } from "revolt.js/esm/maps/Messages"; -import { Nullable } from "revolt.js/esm/util/null"; +import { Channel } from "revolt.js"; +import { Message } from "revolt.js"; +import { Nullable } from "revolt.js"; import { SimpleRenderer } from "./simple/SimpleRenderer"; import { RendererRoutines, ScrollState } from "./types"; diff --git a/src/lib/renderer/types.ts b/src/lib/renderer/types.ts index 951f6fc0..3f2c477a 100644 --- a/src/lib/renderer/types.ts +++ b/src/lib/renderer/types.ts @@ -1,4 +1,4 @@ -import { Message } from "revolt.js/esm/maps/Messages"; +import { Message } from "revolt.js"; import { ChannelRenderer } from "./Singleton"; diff --git a/src/lib/vortex/VoiceState.ts b/src/lib/vortex/VoiceState.ts index 05f9bf94..e83bafec 100644 --- a/src/lib/vortex/VoiceState.ts +++ b/src/lib/vortex/VoiceState.ts @@ -1,6 +1,6 @@ import { action, makeAutoObservable, runInAction } from "mobx"; -import { Channel } from "revolt.js/esm/maps/Channels"; -import { Nullable, toNullable } from "revolt.js/esm/util/null"; +import { Channel } from "revolt.js"; +import { Nullable, toNullable } from "revolt.js"; import type { ProduceType, VoiceUser } from "./Types"; import type VoiceClient from "./VoiceClient"; diff --git a/src/mobx/stores/Auth.ts b/src/mobx/stores/Auth.ts index 24887026..bf1d0aec 100644 --- a/src/mobx/stores/Auth.ts +++ b/src/mobx/stores/Auth.ts @@ -1,6 +1,6 @@ import { action, computed, makeAutoObservable, ObservableMap } from "mobx"; import { API } from "revolt.js"; -import { Nullable } from "revolt.js/esm/util/null"; +import { Nullable } from "revolt.js"; import { mapToRecord } from "../../lib/conversion"; diff --git a/src/mobx/stores/NotificationOptions.ts b/src/mobx/stores/NotificationOptions.ts index 3ac0455a..9632f048 100644 --- a/src/mobx/stores/NotificationOptions.ts +++ b/src/mobx/stores/NotificationOptions.ts @@ -1,7 +1,7 @@ import { action, computed, makeAutoObservable, ObservableMap } from "mobx"; -import { Channel } from "revolt.js/esm/maps/Channels"; -import { Message } from "revolt.js/esm/maps/Messages"; -import { Server } from "revolt.js/esm/maps/Servers"; +import { Channel } from "revolt.js"; +import { Message } from "revolt.js"; +import { Server } from "revolt.js"; import { mapToRecord } from "../../lib/conversion"; diff --git a/src/mobx/stores/ServerConfig.ts b/src/mobx/stores/ServerConfig.ts index de2674ce..4212e82d 100644 --- a/src/mobx/stores/ServerConfig.ts +++ b/src/mobx/stores/ServerConfig.ts @@ -1,7 +1,7 @@ import { action, computed, makeAutoObservable } from "mobx"; import { API } from "revolt.js"; import { Client } from "revolt.js"; -import { Nullable } from "revolt.js/esm/util/null"; +import { Nullable } from "revolt.js"; import { isDebug } from "../../revision"; import Persistent from "../interfaces/Persistent"; diff --git a/src/mobx/stores/helpers/STheme.ts b/src/mobx/stores/helpers/STheme.ts index 4bef8878..9249d6ab 100644 --- a/src/mobx/stores/helpers/STheme.ts +++ b/src/mobx/stores/helpers/STheme.ts @@ -1,3 +1,4 @@ +// @ts-expect-error No typings. import rgba from "color-rgba"; import { makeAutoObservable, computed, action } from "mobx"; diff --git a/src/pages/channels/Channel.tsx b/src/pages/channels/Channel.tsx index 51cb7e1f..f27f5317 100644 --- a/src/pages/channels/Channel.tsx +++ b/src/pages/channels/Channel.tsx @@ -3,7 +3,7 @@ import { Ghost } from "@styled-icons/boxicons-solid"; import { reaction } from "mobx"; import { observer } from "mobx-react-lite"; import { Redirect, useParams } from "react-router-dom"; -import { Channel as ChannelI } from "revolt.js/esm/maps/Channels"; +import { Channel as ChannelI } from "revolt.js"; import styled from "styled-components/macro"; import { Text } from "preact-i18n"; diff --git a/src/pages/channels/ChannelHeader.tsx b/src/pages/channels/ChannelHeader.tsx index d0f97079..69f32d50 100644 --- a/src/pages/channels/ChannelHeader.tsx +++ b/src/pages/channels/ChannelHeader.tsx @@ -6,8 +6,8 @@ import { } from "@styled-icons/boxicons-regular"; import { Notepad, Group } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; -import { Channel } from "revolt.js/esm/maps/Channels"; -import { User } from "revolt.js/esm/maps/Users"; +import { Channel } from "revolt.js"; +import { User } from "revolt.js"; import styled, { css } from "styled-components/macro"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; diff --git a/src/pages/channels/messaging/ConversationStart.tsx b/src/pages/channels/messaging/ConversationStart.tsx index 63269dc9..09ebf235 100644 --- a/src/pages/channels/messaging/ConversationStart.tsx +++ b/src/pages/channels/messaging/ConversationStart.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react-lite"; -import { Channel } from "revolt.js/esm/maps/Channels"; +import { Channel } from "revolt.js"; import styled from "styled-components/macro"; import { Text } from "preact-i18n"; diff --git a/src/pages/channels/messaging/MessageArea.tsx b/src/pages/channels/messaging/MessageArea.tsx index b267e27e..e954eac3 100644 --- a/src/pages/channels/messaging/MessageArea.tsx +++ b/src/pages/channels/messaging/MessageArea.tsx @@ -2,7 +2,7 @@ import { runInAction } from "mobx"; import { observer } from "mobx-react-lite"; import { useHistory, useParams } from "react-router-dom"; import { animateScroll } from "react-scroll"; -import { Channel } from "revolt.js/esm/maps/Channels"; +import { Channel } from "revolt.js"; import styled from "styled-components/macro"; import useResizeObserver from "use-resize-observer"; diff --git a/src/pages/channels/messaging/MessageEditor.tsx b/src/pages/channels/messaging/MessageEditor.tsx index 957046a3..b137561d 100644 --- a/src/pages/channels/messaging/MessageEditor.tsx +++ b/src/pages/channels/messaging/MessageEditor.tsx @@ -1,4 +1,4 @@ -import { Message } from "revolt.js/esm/maps/Messages"; +import { Message } from "revolt.js"; import styled from "styled-components/macro"; import { useContext, useEffect, useState } from "preact/hooks"; diff --git a/src/pages/channels/messaging/MessageRenderer.tsx b/src/pages/channels/messaging/MessageRenderer.tsx index 158d35a5..939cee23 100644 --- a/src/pages/channels/messaging/MessageRenderer.tsx +++ b/src/pages/channels/messaging/MessageRenderer.tsx @@ -3,8 +3,8 @@ import { X } from "@styled-icons/boxicons-regular"; import isEqual from "lodash.isequal"; import { observer } from "mobx-react-lite"; import { API } from "revolt.js"; -import { Message as MessageI } from "revolt.js/esm/maps/Messages"; -import { Nullable } from "revolt.js/esm/util/null"; +import { Message as MessageI } from "revolt.js"; +import { Nullable } from "revolt.js"; import styled from "styled-components/macro"; import { decodeTime } from "ulid"; diff --git a/src/pages/friends/Friend.tsx b/src/pages/friends/Friend.tsx index 783d90e6..844e4c44 100644 --- a/src/pages/friends/Friend.tsx +++ b/src/pages/friends/Friend.tsx @@ -2,7 +2,7 @@ import { X, Plus } from "@styled-icons/boxicons-regular"; import { PhoneCall, Envelope, UserX } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; import { useHistory } from "react-router-dom"; -import { User } from "revolt.js/esm/maps/Users"; +import { User } from "revolt.js"; import styles from "./Friend.module.scss"; import classNames from "classnames"; diff --git a/src/pages/friends/Friends.tsx b/src/pages/friends/Friends.tsx index 668e8afd..1eefebb9 100644 --- a/src/pages/friends/Friends.tsx +++ b/src/pages/friends/Friends.tsx @@ -1,7 +1,7 @@ import { ChevronRight } from "@styled-icons/boxicons-regular"; import { UserDetail, MessageAdd, UserPlus } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; -import { User } from "revolt.js/esm/maps/Users"; +import { User } from "revolt.js"; import styles from "./Friend.module.scss"; import classNames from "classnames"; diff --git a/src/pages/settings/channel/Overview.tsx b/src/pages/settings/channel/Overview.tsx index c18d048f..e728f571 100644 --- a/src/pages/settings/channel/Overview.tsx +++ b/src/pages/settings/channel/Overview.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react-lite"; -import { Channel } from "revolt.js/esm/maps/Channels"; +import { Channel } from "revolt.js"; import styled from "styled-components/macro"; import { Text } from "preact-i18n"; diff --git a/src/pages/settings/channel/Permissions.tsx b/src/pages/settings/channel/Permissions.tsx index dcaa08d4..1144fad2 100644 --- a/src/pages/settings/channel/Permissions.tsx +++ b/src/pages/settings/channel/Permissions.tsx @@ -1,10 +1,13 @@ import isEqual from "lodash.isequal"; import { observer } from "mobx-react-lite"; import { Channel, API } from "revolt.js"; -import { DEFAULT_PERMISSION_DIRECT_MESSAGE } from "revolt.js/esm/api/permissions"; +import { DEFAULT_PERMISSION_DIRECT_MESSAGE } from "revolt.js"; +import { Text } from "preact-i18n"; import { useState } from "preact/hooks"; +import { TextReact } from "../../../lib/i18n"; + import { PermissionsLayout, Button, SpaceBetween, H1 } from "@revoltchat/ui"; import { PermissionList } from "../../../components/settings/roles/PermissionList"; @@ -75,7 +78,12 @@ export default observer(({ channel }: Props) => { return (
-

Permissions for {currentRole.name}

+

+ +