From 7d3149f00317c4f31903df309c491d566b1030ab Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 10 Sep 2024 08:41:02 -0600 Subject: [PATCH 1/3] Allow changing of minigoban size --- src/components/MiniGoban/MiniGoban.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MiniGoban/MiniGoban.tsx b/src/components/MiniGoban/MiniGoban.tsx index 1e4128ce57..d9e7975d28 100644 --- a/src/components/MiniGoban/MiniGoban.tsx +++ b/src/components/MiniGoban/MiniGoban.tsx @@ -308,7 +308,7 @@ export function MiniGoban(props: MiniGobanProps): JSX.Element { goban.current?.destroy(); goban_div.current.childNodes.forEach((node) => node.remove()); }; - }, [props.game_id, props.review_id]); + }, [props.game_id, props.review_id, props.width, props.height]); // Update displayWidth dynamically React.useEffect(() => { From 518f602624c8463cbd16693001f2ee93a827dc19 Mon Sep 17 00:00:00 2001 From: Clinton Christian Date: Tue, 10 Sep 2024 17:49:04 -0400 Subject: [PATCH 2/3] Refactor imports to use @/ alias. --- Gulpfile.js | 43 +++---- package.json | 1 + prettier.config.js | 2 +- src/components/ACLModal/ACLModal.tsx | 16 +-- .../AIReviewStream/AIReviewStream.tsx | 4 +- .../AccountWarning/AccountWarning.tsx | 8 +- .../AccountWarning/CannedMessages.ts | 2 +- .../Achievements/AchievementList.tsx | 2 +- .../ActiveDroppedGameList.tsx | 6 +- .../Announcements/ActiveAnnouncements.tsx | 10 +- .../Announcements/Announcements.tsx | 16 +-- .../Announcements/TournamentIndicator.tsx | 6 +- .../AnnulQueueModal/AnnulQueueModal.tsx | 12 +- .../AutoTranslate/AutoTranslate.tsx | 6 +- .../AutomatchSettings/AutomatchSettings.tsx | 10 +- src/components/BanModal/BanModal.tsx | 10 +- src/components/BlockPlayer/BlockPlayer.ts | 12 +- .../BlockPlayer/BlockPlayerModal.tsx | 4 +- .../ChallengeDetailsReviewPane.tsx | 6 +- .../ChallengeLinkButton.tsx | 4 +- .../ChallengeModal/ChallengeModal.tsx | 45 ++++---- src/components/ChallengeModal/ForkModal.tsx | 14 +-- src/components/Chat/ChatChannelList.tsx | 12 +- src/components/Chat/ChatDetails.tsx | 8 +- src/components/Chat/ChatIndicator.tsx | 6 +- src/components/Chat/ChatLine.tsx | 8 +- src/components/Chat/ChatList.tsx | 16 +-- src/components/Chat/ChatLog.tsx | 30 ++--- src/components/Chat/ChatUsersList.tsx | 12 +- src/components/Chat/chat_markup.tsx | 6 +- src/components/Chat/state.ts | 6 +- .../ChatPresenceIndicator.tsx | 4 +- src/components/ChatUserList/ChatUserList.tsx | 8 +- src/components/Clock/Clock.tsx | 4 +- .../DismissableMessages.tsx | 10 +- .../DismissableNotification.tsx | 2 +- src/components/Dock/Dock.tsx | 4 +- src/components/EmailBanner/EmailBanner.tsx | 8 +- src/components/Errcode/Errcode.tsx | 4 +- src/components/ErrcodeModal/ErrcodeModal.tsx | 8 +- .../ErrorBoundary/ErrorBoundary.tsx | 4 +- src/components/Experiment/Experiment.tsx | 2 +- src/components/Flag/Flag.tsx | 2 +- .../FreeTrialBanner/FreeTrialBanner.tsx | 14 +-- src/components/FreeTrialBanner/LearnMore.tsx | 4 +- .../FreeTrialSurvey/FreeTrialSurvey.tsx | 30 ++--- src/components/FriendList/FriendIndicator.tsx | 8 +- src/components/FriendList/FriendList.tsx | 14 +-- .../GameAcceptModal/GameAcceptModal.tsx | 14 +-- src/components/GameList/GameList.tsx | 10 +- .../GobanContainer/GobanContainer.tsx | 10 +- .../GobanLineSummary/GobanLineSummary.tsx | 14 +-- .../GobanThemePicker/GobanThemePicker.tsx | 6 +- .../GroupAutocomplete/GroupAutocomplete.tsx | 6 +- .../IncidentReportCard.tsx | 20 ++-- .../IncidentReportTracker.tsx | 23 ++-- src/components/JosekiAdmin/JosekiAdmin.tsx | 12 +- .../JosekiPermissionsPanel.tsx | 6 +- .../JosekiSourceModal/JosekiSourceModal.tsx | 4 +- .../JosekiStatsModal/JosekiStatsModal.tsx | 8 +- .../JosekiTagSelector/JosekiTagSelector.tsx | 2 +- .../JosekiVariationFilter.tsx | 8 +- src/components/KBShortcut/KBShortcut.tsx | 2 +- .../LadderComponent/LadderComponent.tsx | 8 +- .../LanguagePicker/LanguagePicker.tsx | 6 +- src/components/Markdown/Markdown.tsx | 12 +- .../MergeReportModal/MergeReportModal.tsx | 4 +- src/components/MiniGoban/MiniGoban.tsx | 24 ++-- src/components/ModNoteModal/ModNoteModal.tsx | 12 +- src/components/Modal/Modal.tsx | 2 +- src/components/ModerateUser/ModerateUser.tsx | 20 ++-- .../ModerationOffer/ModerationOffer.tsx | 2 +- .../ModerationOffer/ModerationOfferModal.tsx | 12 +- .../ModerationOfferControl.tsx | 2 +- src/components/NavBar/NavBar.tsx | 40 +++---- src/components/NavBar/OmniSearch.tsx | 10 +- .../NetworkStatus/NetworkStatus.tsx | 8 +- .../NewUserRankChooser/NewUserRankChooser.tsx | 8 +- src/components/NotesModal/NotesModal.tsx | 4 +- .../NotificationIndicator.tsx | 4 +- .../Notifications/NotificationManager.tsx | 28 ++--- .../Notifications/Notifications.tsx | 26 ++--- .../ObserveGamesComponent.tsx | 14 +-- .../OgsHelpProvider/OgsHelpProvider.tsx | 6 +- .../PaginatedTable/PaginatedTable.styl | 11 +- .../PaginatedTable/PaginatedTable.tsx | 6 +- .../PaymentProblemBanner.tsx | 8 +- src/components/Player/Player.tsx | 24 ++-- src/components/Player/PlayerDetails.tsx | 46 ++++---- .../PlayerAutocomplete/PlayerAutocomplete.tsx | 10 +- src/components/PlayerIcon/PlayerIcon.tsx | 6 +- .../PlayerNotesModal/PlayerNotesModal.tsx | 6 +- src/components/PrivateChat/PrivateChat.tsx | 30 ++--- src/components/ProfileCard/ProfileCard.tsx | 8 +- src/components/RatingsChart/RatingEntry.ts | 2 +- src/components/RatingsChart/RatingsChart.tsx | 12 +- .../RatingsChartByGame/RatingEntry.ts | 2 +- .../RatingsChartByGame/RatingsChartByGame.tsx | 14 +-- .../RengoManagementPane.tsx | 6 +- .../RengoTeamManagementPane.tsx | 16 +-- src/components/Report/Report.tsx | 22 ++-- .../ReportedConversationModal.tsx | 8 +- .../SGFPasteModal/SGFPasteModal.tsx | 4 +- src/components/SeekGraph/SeekGraph.tsx | 36 +++--- src/components/SeekGraph/SeekGraphLegend.tsx | 8 +- .../ServerTimeDisplay/ServerTimeDisplay.tsx | 4 +- .../SocialLoginButtons/SocialLoginButtons.tsx | 2 +- .../SupporterProblems/SupporterProblems.tsx | 8 +- .../TimeControl/TimeControlPicker.tsx | 4 +- .../TimeControl/TimeControlUpdates.ts | 4 +- src/components/TimeControl/util.ts | 2 +- .../TurnIndicator/TurnIndicator.tsx | 2 +- .../TypedEventEmitterPureComponent.tsx | 2 +- src/components/UIPush/UIPush.tsx | 2 +- src/lib/ITC.ts | 2 +- src/lib/SettingsCommon.tsx | 6 +- src/lib/auth.ts | 12 +- src/lib/automatch_manager.tsx | 10 +- src/lib/bots.ts | 4 +- src/lib/cached.ts | 10 +- src/lib/chat_manager.ts | 26 ++--- src/lib/configure-goban.tsx | 14 +-- src/lib/data.ts | 8 +- src/lib/data_schema.ts | 10 +- src/lib/hooks.ts | 2 +- src/lib/localize-time.ts | 2 +- src/lib/misc.ts | 10 +- src/lib/moderation.tsx | 12 +- src/{ => lib}/ogsHistory.ts | 0 src/lib/online_status.ts | 6 +- src/lib/player_cache.ts | 8 +- src/lib/popover.tsx | 2 +- src/lib/preferences.ts | 6 +- src/lib/profanity_filter.ts | 2 +- src/lib/rank_utils.ts | 2 +- src/lib/rengo_balancer.ts | 4 +- src/lib/rengo_utils.ts | 6 +- src/lib/report_manager.tsx | 20 ++-- src/lib/report_util.ts | 8 +- src/lib/requests.ts | 2 +- src/lib/sockets.ts | 10 +- src/lib/swal_config.ts | 2 +- src/lib/tab_complete.ts | 2 +- src/lib/toast.tsx | 2 +- src/lib/translate.ts | 14 --- src/lib/types.ts | 2 +- src/main.tsx | 47 ++++---- src/ogs.styl | 2 +- src/routes.tsx | 108 +++++++++--------- .../TemplateComponent/TemplateComponent.tsx | 4 +- src/views/Admin/Admin.tsx | 6 +- src/views/Admin/FlaggedGames.tsx | 6 +- src/views/Admin/MerchantLog.tsx | 4 +- src/views/Admin/OnlineLeaguesAdmin.tsx | 4 +- .../AnnouncementCenter/AnnouncementCenter.tsx | 24 ++-- src/views/Appeal/Appeal.tsx | 18 +-- src/views/AppealsCenter/AppealsCenter.tsx | 12 +- src/views/BlockedVPN/BlockedVPN.tsx | 6 +- .../ChallengeLinkLanding.tsx | 26 ++--- src/views/ChatView/ChatView.tsx | 4 +- src/views/Developer/Developer.tsx | 4 +- src/views/Firewall/Firewall.tsx | 24 ++-- .../ForceUsernameChange.tsx | 12 +- src/views/Game/AIDemoReview.tsx | 14 +-- src/views/Game/AIReview.tsx | 28 ++--- src/views/Game/AIReviewChart.tsx | 8 +- src/views/Game/AntiGrief.tsx | 12 +- src/views/Game/BotDetectionResults.tsx | 4 +- src/views/Game/ConditionalMoveTreeDisplay.tsx | 2 +- src/views/Game/Game.tsx | 40 +++---- src/views/Game/GameChat.tsx | 22 ++-- src/views/Game/GameDock.test.tsx | 2 +- src/views/Game/GameDock.tsx | 30 ++--- src/views/Game/GameHooks.ts | 2 +- src/views/Game/GameInfoModal.tsx | 24 ++-- src/views/Game/GameLinkModal.tsx | 6 +- src/views/Game/GameLog.tsx | 14 +-- src/views/Game/GameLogModal.tsx | 8 +- src/views/Game/GameTimings.tsx | 6 +- src/views/Game/PlayButtons.test.tsx | 4 +- src/views/Game/PlayButtons.tsx | 10 +- src/views/Game/PlayControls.test.tsx | 4 +- src/views/Game/PlayControls.tsx | 32 +++--- src/views/Game/PlayerCards.test.tsx | 2 +- src/views/Game/PlayerCards.tsx | 30 ++--- src/views/Game/game_control.ts | 2 +- src/views/Game/tree-lastnode.png | Bin 144 -> 0 bytes src/views/Game/tree-node.png | Bin 145 -> 0 bytes src/views/Game/tree-vline.png | Bin 123 -> 0 bytes src/views/Game/util.ts | 2 +- src/views/GameEmbed/GameEmbed.tsx | 4 +- src/views/GoTV/GoTV.tsx | 6 +- src/views/GoTV/GoTVIndicator.tsx | 2 +- src/views/GoTV/GoTVNotification.tsx | 2 +- src/views/GoTV/GoTVNotifier.tsx | 4 +- src/views/GoTV/StreamManager.ts | 6 +- src/views/GoTV/useTwitchIntegration.ts | 2 +- src/views/Group/Group.tsx | 44 +++---- src/views/GroupCreate/GroupCreate.tsx | 8 +- src/views/GroupList/GroupList.tsx | 12 +- .../HelpFlows/CommunityModeratorIntro.tsx | 2 +- src/views/HelpFlows/GameLogHelp.tsx | 9 +- src/views/HelpFlows/GuestUserIntro.tsx | 2 +- src/views/HelpFlows/GuestUserIntroRengo.tsx | 2 +- src/views/HelpFlows/HelpFlows.tsx | 2 +- src/views/HelpFlows/OJEIntro.tsx | 2 +- src/views/HelpFlows/OOLSpectatorIntro.tsx | 2 +- src/views/HelpFlows/OOLUserIntro.tsx | 2 +- src/views/HelpFlows/UndoIntro.tsx | 2 +- src/views/Joseki/Joseki.tsx | 34 +++--- src/views/Ladder/Ladder.tsx | 28 ++--- src/views/LadderList/LadderList.tsx | 12 +- src/views/LearningHub/Capture.tsx | 2 +- src/views/LearningHub/Defend.tsx | 2 +- src/views/LearningHub/EndingTheGame.tsx | 2 +- src/views/LearningHub/InstructionalGoban.tsx | 4 +- src/views/LearningHub/Intro.tsx | 2 +- src/views/LearningHub/Ko.tsx | 2 +- src/views/LearningHub/Ladders.tsx | 2 +- src/views/LearningHub/LearningHub.tsx | 14 +-- src/views/LearningHub/LearningPage.tsx | 6 +- src/views/LearningHub/Seki.tsx | 2 +- src/views/LearningHub/SnapBack.tsx | 2 +- src/views/LearningHub/TheBoard.tsx | 2 +- src/views/LearningHub/sections.ts | 2 +- src/views/LearningHub/util.ts | 2 +- src/views/LibraryPlayer/LibraryPlayer.tsx | 28 ++--- src/views/Moderator/Moderator.tsx | 16 +-- src/views/Moderator/ban_functions.tsx | 8 +- src/views/ObserveGames/ObserveGames.tsx | 2 +- .../OnlineLeaguePlayerLanding.test.tsx | 8 +- .../OnlineLeaguePlayerLanding.tsx | 20 ++-- .../OnlineLeagueSpectatorLanding.tsx | 16 +-- src/views/Overview/ChallengesList.tsx | 24 ++-- src/views/Overview/EXV6Overview.tsx | 36 +++--- src/views/Overview/InviteList.tsx | 32 +++--- src/views/Overview/Overview.tsx | 48 ++++---- src/views/Play/Play.tsx | 58 +++++----- src/views/Prizes/PrizeBatch.tsx | 29 +++-- src/views/Prizes/PrizeBatchList.tsx | 6 +- src/views/Prizes/PrizeRedemption.tsx | 6 +- src/views/Puzzle/Puzzle.tsx | 34 +++--- src/views/Puzzle/PuzzleEditing.ts | 8 +- src/views/Puzzle/PuzzleSettingsModal.tsx | 4 +- .../PuzzleCollection/PuzzleCollection.tsx | 12 +- .../PuzzleCollection/PuzzleCollectionList.tsx | 20 ++-- .../PuzzleCollection/SortablePuzzleList.tsx | 12 +- src/views/PuzzleList/PuzzleList.tsx | 20 ++-- .../RatingCalculator/RatingCalculator.tsx | 10 +- src/views/Register/Register.tsx | 22 ++-- src/views/ReportsCenter/AppealView.tsx | 2 +- src/views/ReportsCenter/MessageTemplate.tsx | 16 +-- .../ModerationActionSelector.tsx | 6 +- .../ReportsCenter/ReportTypeSelector.tsx | 2 +- src/views/ReportsCenter/ReportedGame.tsx | 27 +++-- src/views/ReportsCenter/ReportsCenter.tsx | 12 +- .../ReportsCenterCMDashboard.tsx | 18 +-- .../ReportsCenter/ReportsCenterCMHistory.tsx | 2 +- .../ReportsCenter/ReportsCenterHistory.tsx | 6 +- .../ReportsCenter/ReportsCenterSettings.tsx | 8 +- src/views/ReportsCenter/UserHistory.tsx | 8 +- src/views/ReportsCenter/ViewReport.tsx | 30 ++--- src/views/Settings/AccountSettings.test.tsx | 6 +- src/views/Settings/AccountSettings.tsx | 28 ++--- .../Settings/AnnouncementPreferences.tsx | 18 +-- .../Settings/BlockedPlayerPreferences.tsx | 6 +- src/views/Settings/ChatPreferences.tsx | 8 +- src/views/Settings/EmailPreferences.tsx | 10 +- src/views/Settings/GamePreferences.tsx | 10 +- src/views/Settings/GeneralPreferences.tsx | 22 ++-- src/views/Settings/GoTVPreferences.tsx | 10 +- src/views/Settings/HelpSettings.tsx | 6 +- src/views/Settings/LinkPreferences.tsx | 16 +-- src/views/Settings/ModeratorPreferences.tsx | 14 +-- src/views/Settings/Settings.tsx | 24 ++-- src/views/Settings/SoundPreferences.tsx | 20 ++-- src/views/Settings/ThemePreferences.tsx | 22 ++-- src/views/Settings/VacationSettings.tsx | 10 +- src/views/SignIn/SignIn.tsx | 20 ++-- src/views/Styling/Styling.tsx | 28 ++--- src/views/Supporter/BecomeASiteSupporter.tsx | 6 +- src/views/Supporter/Supporter.tsx | 20 ++-- src/views/Tournament/Tournament.tsx | 50 ++++---- src/views/TournamentList/TournamentList.tsx | 24 ++-- .../TournamentRecord/TournamentRecord.tsx | 18 +-- src/views/User/ActivityCard.tsx | 8 +- src/views/User/AvatarCard.tsx | 26 ++--- src/views/User/BotControls.tsx | 8 +- src/views/User/CMPieCharts.tsx | 6 +- src/views/User/GameHistoryTable.tsx | 58 ++++------ src/views/User/ModLog.tsx | 8 +- src/views/User/ModTools.tsx | 22 ++-- src/views/User/ReviewsAndDemosTable.tsx | 12 +- src/views/User/User.tsx | 38 +++--- src/views/User/UserByName.tsx | 6 +- src/views/User/UserVoteActionSummary.tsx | 6 +- src/views/User/VersusCard.tsx | 6 +- src/views/User/VoteActivityGraph.tsx | 6 +- src/views/User/common.ts | 6 +- src/views/VerifyEmail/VerifyEmail.tsx | 6 +- src/views/docs/About.tsx | 6 +- src/views/docs/GoResources.tsx | 8 +- src/views/docs/Team.tsx | 10 +- tsconfig.json | 17 +-- webpack.config.js | 24 ++-- 305 files changed, 1765 insertions(+), 1799 deletions(-) rename src/{ => lib}/ogsHistory.ts (100%) diff --git a/Gulpfile.js b/Gulpfile.js index e3086e4102..9895a1d2fe 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -6,22 +6,28 @@ BACKEND = BACKEND.toUpperCase(); //BACKEND = 'PRODUCTION'; //BACKEND = 'LOCAL'; -const spawn = require("child_process").spawn; -const fs = require("fs"); -const gulp = require("gulp"); -const path = require("path"); -const execSync = require("child_process").execSync; -const livereload = require("gulp-livereload"); -const stylus = require("gulp-stylus"); -const sourcemaps = require("gulp-sourcemaps"); -const rename = require("gulp-rename"); -const pump = require("pump"); -const autoprefixer = require("autoprefixer"); -const postcss = require("gulp-postcss"); -const cssnano = require("cssnano"); -const inline_svg = require("postcss-inline-svg"); -const gulpEslint = require("gulp-eslint-new"); -const html_minifier = require("html-minifier").minify; +import { spawn, execSync } from "child_process"; +import fs from "fs"; +import gulp from "gulp"; +import path from "path"; +import livereload from "gulp-livereload"; + +import stylus from "gulp-stylus"; +import sourcemaps from "gulp-sourcemaps"; +import rename from "gulp-rename"; +import pump from "pump"; +import autoprefixer from "autoprefixer"; +import postcss from "gulp-postcss"; +import cssnano from "cssnano"; +import inline_svg from "postcss-inline-svg"; +import gulpEslint from "gulp-eslint-new"; +import html_minifier from "html-minifier"; + +import express from "express"; +import body_parser from "body-parser"; +import http from "http"; +import proxy from "express-http-proxy"; +import url from "url"; let ts_sources = ["src/**/*.ts", "src/**/*.tsx", "!src/**/*.test.ts", "!src/**/*.test.tsx"]; @@ -187,11 +193,6 @@ function dev_server(done) { process.exit(1); } - let express = require("express"); - let body_parser = require("body-parser"); - let http = require("http"); - var proxy = require("express-http-proxy"); - let url = require("url"); let dev_server = express(); dev_server.use(body_parser.json()); dev_server.use(body_parser.text()); diff --git a/package.json b/package.json index 41e154e88f..31bdde6306 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "url": "https://github.com/online-go/online-go.com/issues", "license": "AGPL-3.0", "private": true, + "type": "module", "engine": { "npm": ">=8.5.0" }, diff --git a/prettier.config.js b/prettier.config.js index b148ff5196..bc5d498434 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { trailingComma: "all", tabWidth: 4, printWidth: 100, diff --git a/src/components/ACLModal/ACLModal.tsx b/src/components/ACLModal/ACLModal.tsx index 0d66119979..026ffe3dd8 100644 --- a/src/components/ACLModal/ACLModal.tsx +++ b/src/components/ACLModal/ACLModal.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { post, get, del } from "requests"; -import { openModal, Modal } from "Modal"; -import { Player } from "Player"; -import { PlayerAutocomplete, PlayerAutocompleteRef } from "PlayerAutocomplete"; -import { GroupAutocomplete } from "GroupAutocomplete"; -import { errorAlerter } from "misc"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { _ } from "@/lib/translate"; +import { post, get, del } from "@/lib/requests"; +import { openModal, Modal } from "@/components/Modal"; +import { Player } from "@/components/Player"; +import { PlayerAutocomplete, PlayerAutocompleteRef } from "@/components/PlayerAutocomplete"; +import { GroupAutocomplete } from "@/components/GroupAutocomplete"; +import { errorAlerter } from "@/lib/misc"; +import { PlayerCacheEntry } from "@/lib/player_cache"; interface Events {} diff --git a/src/components/AIReviewStream/AIReviewStream.tsx b/src/components/AIReviewStream/AIReviewStream.tsx index aeb1af16d2..6c8f7c3c8f 100644 --- a/src/components/AIReviewStream/AIReviewStream.tsx +++ b/src/components/AIReviewStream/AIReviewStream.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { ai_socket } from "sockets"; +import { ai_socket } from "@/lib/sockets"; import { MoveTree, GobanSocketEvents } from "goban"; -import { IdType } from "src/lib/types"; +import { IdType } from "@/lib/types"; const analysis_requests_made: { [id: string]: boolean } = {}; diff --git a/src/components/AccountWarning/AccountWarning.tsx b/src/components/AccountWarning/AccountWarning.tsx index 0d7a5b1cc9..ad1aae8fa5 100644 --- a/src/components/AccountWarning/AccountWarning.tsx +++ b/src/components/AccountWarning/AccountWarning.tsx @@ -20,10 +20,10 @@ // So the word "warning" kind of means "message" now. import * as React from "react"; -import { _, pgettext } from "translate"; -import { get, patch } from "requests"; -import { useMainGoban, useUser } from "hooks"; -import { AutoTranslate } from "AutoTranslate"; +import { _, pgettext } from "@/lib/translate"; +import { get, patch } from "@/lib/requests"; +import { useMainGoban, useUser } from "@/lib/hooks"; +import { AutoTranslate } from "@/components/AutoTranslate"; import { useLocation } from "react-router"; import { CANNED_MESSAGES } from "./CannedMessages"; diff --git a/src/components/AccountWarning/CannedMessages.ts b/src/components/AccountWarning/CannedMessages.ts index c85dbc9f07..38772ddb30 100644 --- a/src/components/AccountWarning/CannedMessages.ts +++ b/src/components/AccountWarning/CannedMessages.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { _, interpolate } from "translate"; +import { _, interpolate } from "@/lib/translate"; // These are the "canned messages" that Community Moderators can vote for. diff --git a/src/components/Achievements/AchievementList.tsx b/src/components/Achievements/AchievementList.tsx index 53f68392eb..c71be622e6 100644 --- a/src/components/Achievements/AchievementList.tsx +++ b/src/components/Achievements/AchievementList.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -//import * as preferences from "preferences"; +//import * as preferences from "@/lib/preferences"; interface AchievementEntry { name: string; diff --git a/src/components/ActiveDroppedGameList/ActiveDroppedGameList.tsx b/src/components/ActiveDroppedGameList/ActiveDroppedGameList.tsx index 82cdb6f4ea..0f34bf56d5 100644 --- a/src/components/ActiveDroppedGameList/ActiveDroppedGameList.tsx +++ b/src/components/ActiveDroppedGameList/ActiveDroppedGameList.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { GameList } from "GameList"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { _ } from "@/lib/translate"; +import { GameList } from "@/components/GameList"; +import { PlayerCacheEntry } from "@/lib/player_cache"; interface UserType { id: number; diff --git a/src/components/Announcements/ActiveAnnouncements.tsx b/src/components/Announcements/ActiveAnnouncements.tsx index 19089c3c39..ec0ce40888 100644 --- a/src/components/Announcements/ActiveAnnouncements.tsx +++ b/src/components/Announcements/ActiveAnnouncements.tsx @@ -17,8 +17,8 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { interpolate, _ } from "translate"; -import { Card, PopupMenu, PopupMenuItem } from "material"; +import { interpolate, _ } from "@/lib/translate"; +import { Card, PopupMenu, PopupMenuItem } from "@/components/material"; import { active_announcements, @@ -28,10 +28,10 @@ import { } from "./Announcements"; import { getBlocks, setAnnouncementBlock } from "../BlockPlayer"; -import * as data from "data"; -import * as preferences from "preferences"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; // Holds the expirations dates of cleared announcements const hard_cleared_announcements: { [id: number]: number } = data.get( diff --git a/src/components/Announcements/Announcements.tsx b/src/components/Announcements/Announcements.tsx index 2c5625f28b..f917d6876f 100644 --- a/src/components/Announcements/Announcements.tsx +++ b/src/components/Announcements/Announcements.tsx @@ -17,15 +17,15 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { get } from "requests"; -import { UIPush } from "UIPush"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import { errorLogger } from "misc"; -import * as moment from "moment"; -import ITC from "ITC"; -import * as data from "data"; +import { get } from "@/lib/requests"; +import { UIPush } from "@/components/UIPush"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { errorLogger } from "@/lib/misc"; +import moment from "moment"; +import ITC from "@/lib/ITC"; +import * as data from "@/lib/data"; import { getBlocks } from "../BlockPlayer"; -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; interface Events { announcement: any; diff --git a/src/components/Announcements/TournamentIndicator.tsx b/src/components/Announcements/TournamentIndicator.tsx index 8c44a3bcd1..5104245dfe 100644 --- a/src/components/Announcements/TournamentIndicator.tsx +++ b/src/components/Announcements/TournamentIndicator.tsx @@ -17,9 +17,9 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import * as data from "data"; -import * as moment from "moment"; -import { usePreference } from "preferences"; +import * as data from "@/lib/data"; +import moment from "moment"; +import { usePreference } from "@/lib/preferences"; export function TournamentIndicator(): JSX.Element | null { const [tournament, setTournament] = React.useState(null); diff --git a/src/components/AnnulQueueModal/AnnulQueueModal.tsx b/src/components/AnnulQueueModal/AnnulQueueModal.tsx index 5802bb06e8..8b352d4051 100644 --- a/src/components/AnnulQueueModal/AnnulQueueModal.tsx +++ b/src/components/AnnulQueueModal/AnnulQueueModal.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { MiniGoban } from "MiniGoban"; +import { _ } from "@/lib/translate"; +import { MiniGoban } from "@/components/MiniGoban"; import { GobanRenderer } from "goban"; -import { AIReview, GameTimings, ChatMode, GameChat, GobanContext } from "Game"; -import { Player } from "Player"; -import { Resizable } from "Resizable"; -import { post, put } from "requests"; +import { AIReview, GameTimings, ChatMode, GameChat, GobanContext } from "@/views/Game"; +import { Player } from "@/components/Player"; +import { Resizable } from "@/components/Resizable"; +import { post, put } from "@/lib/requests"; // Define the AnnulQueueModalProps interface interface AnnulQueueModalProps { diff --git a/src/components/AutoTranslate/AutoTranslate.tsx b/src/components/AutoTranslate/AutoTranslate.tsx index fec6b1ea77..dfe897be31 100644 --- a/src/components/AutoTranslate/AutoTranslate.tsx +++ b/src/components/AutoTranslate/AutoTranslate.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { post } from "requests"; -import { current_language, pgettext } from "translate"; -import { Markdown } from "Markdown"; +import { post } from "@/lib/requests"; +import { current_language, pgettext } from "@/lib/translate"; +import { Markdown } from "@/components/Markdown"; interface AutoTranslateProps { source: string | null | undefined; diff --git a/src/components/AutomatchSettings/AutomatchSettings.tsx b/src/components/AutomatchSettings/AutomatchSettings.tsx index 666e44054e..5049da8211 100644 --- a/src/components/AutomatchSettings/AutomatchSettings.tsx +++ b/src/components/AutomatchSettings/AutomatchSettings.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; -import { dup } from "misc"; -import * as data from "data"; -import { AutomatchPreferencesBase, AutomatchTimeControlSystem, Size, Speed } from "src/lib/types"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; +import { dup } from "@/lib/misc"; +import * as data from "@/lib/data"; +import { AutomatchPreferencesBase, AutomatchTimeControlSystem, Size, Speed } from "@/lib/types"; import { AutomatchCondition, RuleSet } from "goban"; interface Events {} diff --git a/src/components/BanModal/BanModal.tsx b/src/components/BanModal/BanModal.tsx index 74cbcb29df..11562bb7ff 100644 --- a/src/components/BanModal/BanModal.tsx +++ b/src/components/BanModal/BanModal.tsx @@ -17,11 +17,11 @@ import * as React from "react"; import Datetime from "react-datetime"; -import { put } from "requests"; -import { _ } from "translate"; -import { errorAlerter } from "misc"; -import { Modal } from "Modal"; -import * as player_cache from "player_cache"; +import { put } from "@/lib/requests"; +import { _ } from "@/lib/translate"; +import { errorAlerter } from "@/lib/misc"; +import { Modal } from "@/components/Modal"; +import * as player_cache from "@/lib/player_cache"; interface Events {} diff --git a/src/components/BlockPlayer/BlockPlayer.ts b/src/components/BlockPlayer/BlockPlayer.ts index 715c4d6b2b..ccdd6cfe32 100644 --- a/src/components/BlockPlayer/BlockPlayer.ts +++ b/src/components/BlockPlayer/BlockPlayer.ts @@ -15,12 +15,12 @@ * along with this program. If not, see . */ -import { put } from "requests"; -import * as data from "data"; -import { errorAlerter, errorLogger } from "misc"; -import ITC from "ITC"; -import cached from "cached"; -import * as player_cache from "player_cache"; +import { put } from "@/lib/requests"; +import * as data from "@/lib/data"; +import { errorAlerter, errorLogger } from "@/lib/misc"; +import ITC from "@/lib/ITC"; +import cached from "@/lib/cached"; +import * as player_cache from "@/lib/player_cache"; export class BlockState { blocked: number; // player id diff --git a/src/components/BlockPlayer/BlockPlayerModal.tsx b/src/components/BlockPlayer/BlockPlayerModal.tsx index 6583b57c7e..f271b2ad27 100644 --- a/src/components/BlockPlayer/BlockPlayerModal.tsx +++ b/src/components/BlockPlayer/BlockPlayerModal.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { PopOver, popover } from "popover"; +import { _ } from "@/lib/translate"; +import { PopOver, popover } from "@/lib/popover"; import { BlockState, getBlocks, diff --git a/src/components/ChallengeDetailsReviewPane/ChallengeDetailsReviewPane.tsx b/src/components/ChallengeDetailsReviewPane/ChallengeDetailsReviewPane.tsx index 7d0403c1ba..f85691cb49 100644 --- a/src/components/ChallengeDetailsReviewPane/ChallengeDetailsReviewPane.tsx +++ b/src/components/ChallengeDetailsReviewPane/ChallengeDetailsReviewPane.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { pgettext, _ } from "translate"; +import { pgettext, _ } from "@/lib/translate"; -import { timeControlDescription, usedForCheating } from "TimeControl"; -import { rulesText, yesno } from "misc"; +import { timeControlDescription, usedForCheating } from "@/components/TimeControl"; +import { rulesText, yesno } from "@/lib/misc"; type Challenge = socket_api.seekgraph_global.Challenge; diff --git a/src/components/ChallengeLinkButton/ChallengeLinkButton.tsx b/src/components/ChallengeLinkButton/ChallengeLinkButton.tsx index 791e1eb1cc..2c51769365 100644 --- a/src/components/ChallengeLinkButton/ChallengeLinkButton.tsx +++ b/src/components/ChallengeLinkButton/ChallengeLinkButton.tsx @@ -17,9 +17,9 @@ import * as React from "react"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; -import { popover } from "popover"; +import { popover } from "@/lib/popover"; type ChallengeLinkButtonProps = { uuid: string; diff --git a/src/components/ChallengeModal/ChallengeModal.tsx b/src/components/ChallengeModal/ChallengeModal.tsx index 138539e9a9..1d16c05396 100644 --- a/src/components/ChallengeModal/ChallengeModal.tsx +++ b/src/components/ChallengeModal/ChallengeModal.tsx @@ -16,30 +16,33 @@ */ import * as React from "react"; -import * as data from "data"; -import * as player_cache from "player_cache"; - -import { OgsResizeDetector } from "OgsResizeDetector"; -import { browserHistory } from "ogsHistory"; -import { _, pgettext, interpolate } from "translate"; -import { post, del } from "requests"; -import { Modal, openModal } from "Modal"; -import { socket } from "sockets"; -import { rankString, getUserRating, amateurRanks, allRanks } from "rank_utils"; -import { CreatedChallengeInfo, RuleSet } from "types"; -import { errorLogger, errorAlerter, rulesText, dup } from "misc"; -import { PlayerIcon } from "PlayerIcon"; +import * as data from "@/lib/data"; +import * as player_cache from "@/lib/player_cache"; + +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { post, del } from "@/lib/requests"; +import { Modal, openModal } from "@/components/Modal"; +import { socket } from "@/lib/sockets"; +import { rankString, getUserRating, amateurRanks, allRanks } from "@/lib/rank_utils"; +import { CreatedChallengeInfo, RuleSet } from "@/lib/types"; +import { errorLogger, errorAlerter, rulesText, dup } from "@/lib/misc"; +import { PlayerIcon } from "@/components/PlayerIcon"; import { shortShortTimeControl, isLiveGame, TimeControlPicker, timeControlSystemText, TimeControl, -} from "TimeControl"; -import { sfx } from "sfx"; -import { notification_manager, NotificationManagerEvents } from "Notifications/NotificationManager"; -import { one_bot, bot_count, bots_list } from "bots"; -import { goban_view_mode } from "Game/util"; +} from "@/components/TimeControl"; +import { sfx } from "@/lib/sfx"; +import { + notification_manager, + NotificationManagerEvents, +} from "@/components/Notifications/NotificationManager"; +import { one_bot, bot_count, bots_list } from "@/lib/bots"; +import { goban_view_mode } from "@/views/Game/util"; import { GobanRenderer, GobanEngineConfig, @@ -50,14 +53,14 @@ import { JGOFTimeControlSystem, } from "goban"; -import { copyChallengeLinkURL } from "ChallengeLinkButton"; +import { copyChallengeLinkURL } from "@/components/ChallengeLinkButton"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import { recallTimeControlSettings, saveTimeControlSettings, updateSystem, -} from "TimeControl/TimeControlUpdates"; +} from "@/components/TimeControl/TimeControlUpdates"; export type ChallengeDetails = rest_api.ChallengeDetails; diff --git a/src/components/ChallengeModal/ForkModal.tsx b/src/components/ChallengeModal/ForkModal.tsx index b2ba370bf1..3cf91fd68e 100644 --- a/src/components/ChallengeModal/ForkModal.tsx +++ b/src/components/ChallengeModal/ForkModal.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import * as data from "data"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; import { GobanRenderer } from "goban"; -import { PlayerAutocomplete } from "PlayerAutocomplete"; -import { MiniGoban } from "MiniGoban"; -import { challenge } from "ChallengeModal"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { PlayerAutocomplete } from "@/components/PlayerAutocomplete"; +import { MiniGoban } from "@/components/MiniGoban"; +import { challenge } from "@/components/ChallengeModal"; +import { PlayerCacheEntry } from "@/lib/player_cache"; interface Events {} diff --git a/src/components/Chat/ChatChannelList.tsx b/src/components/Chat/ChatChannelList.tsx index 8ecc55a852..7bd6cc109a 100644 --- a/src/components/Chat/ChatChannelList.tsx +++ b/src/components/Chat/ChatChannelList.tsx @@ -16,12 +16,12 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, pgettext } from "translate"; +import * as data from "@/lib/data"; +import { _, pgettext } from "@/lib/translate"; import { useEffect, useState, useCallback } from "react"; -import { Flag } from "Flag"; -import { browserHistory } from "ogsHistory"; -import { errorLogger, slugify } from "misc"; +import { Flag } from "@/components/Flag"; +import { browserHistory } from "@/lib/ogsHistory"; +import { errorLogger, slugify } from "@/lib/misc"; import { chat_manager, ChatChannelProxy, @@ -31,7 +31,7 @@ import { ChannelInformation, resolveChannelInformation, cachedChannelInformation, -} from "chat_manager"; +} from "@/lib/chat_manager"; data.setDefault("chat.joined", { "global-english": true }); diff --git a/src/components/Chat/ChatDetails.tsx b/src/components/Chat/ChatDetails.tsx index 1ff24baf7e..a4fbce57b9 100644 --- a/src/components/Chat/ChatDetails.tsx +++ b/src/components/Chat/ChatDetails.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { pgettext } from "translate"; -import { close_all_popovers } from "popover"; -import { close_friend_list } from "FriendList/close_friend_list"; -import * as data from "data"; +import { pgettext } from "@/lib/translate"; +import { close_all_popovers } from "@/lib/popover"; +import { close_friend_list } from "@/components/FriendList/close_friend_list"; +import * as data from "@/lib/data"; import { getUnreadChatPreference, getMentionedChatPreference, diff --git a/src/components/Chat/ChatIndicator.tsx b/src/components/Chat/ChatIndicator.tsx index e84b6e5c8a..197d9d2eac 100644 --- a/src/components/Chat/ChatIndicator.tsx +++ b/src/components/Chat/ChatIndicator.tsx @@ -22,11 +22,11 @@ import { global_channels, group_channels, tournament_channels, -} from "chat_manager"; -import * as data from "data"; +} from "@/lib/chat_manager"; +import * as data from "@/lib/data"; import { KBShortcut } from "../KBShortcut"; import { ChatList } from "./ChatList"; -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; import { chat_subscriptions, getUnreadChatPreference, diff --git a/src/components/Chat/ChatLine.tsx b/src/components/Chat/ChatLine.tsx index 8f980689b4..cdffdb4ae5 100644 --- a/src/components/Chat/ChatLine.tsx +++ b/src/components/Chat/ChatLine.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import * as moment from "moment"; -import * as data from "data"; -import { Player } from "Player"; +import moment from "moment"; +import * as data from "@/lib/data"; +import { Player } from "@/components/Player"; import { chat_markup } from "./chat_markup"; -import { ChatMessage } from "chat_manager"; +import { ChatMessage } from "@/lib/chat_manager"; let name_match_regex = /^loading...$/; data.watch("config.user", (user) => { diff --git a/src/components/Chat/ChatList.tsx b/src/components/Chat/ChatList.tsx index 1237894275..8630959612 100644 --- a/src/components/Chat/ChatList.tsx +++ b/src/components/Chat/ChatList.tsx @@ -16,19 +16,19 @@ */ import * as React from "react"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; import { group_channels, tournament_channels, global_channels, ChatChannelProxy, chat_manager, -} from "chat_manager"; -import * as data from "data"; -import { Flag } from "Flag"; -import { shouldOpenNewTab } from "misc"; -import { browserHistory } from "ogsHistory"; -import { popover } from "popover"; +} from "@/lib/chat_manager"; +import * as data from "@/lib/data"; +import { Flag } from "@/components/Flag"; +import { shouldOpenNewTab } from "@/lib/misc"; +import { browserHistory } from "@/lib/ogsHistory"; +import { popover } from "@/lib/popover"; import { getUnreadChatPreference, getMentionedChatPreference, @@ -36,7 +36,7 @@ import { unwatchChatSubscriptionChanged, } from "./state"; import { ChatDetails } from "./ChatDetails"; -import { DataSchema } from "data_schema"; +import { DataSchema } from "@/lib/data_schema"; interface ChatListProperties { show_unjoined?: boolean; diff --git a/src/components/Chat/ChatLog.tsx b/src/components/Chat/ChatLog.tsx index bee83f62f8..a7584ecd42 100644 --- a/src/components/Chat/ChatLog.tsx +++ b/src/components/Chat/ChatLog.tsx @@ -16,16 +16,16 @@ */ import * as React from "react"; -import * as data from "data"; -import * as moment from "moment"; +import * as data from "@/lib/data"; +import moment from "moment"; import Linkify from "react-linkify"; import Split from "react-split"; -import { Card } from "material"; -import { socket } from "sockets"; -import { _, pgettext, interpolate } from "translate"; -import { localize_time_strings } from "localize-time"; +import { Card } from "@/components/material"; +import { socket } from "@/lib/sockets"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { localize_time_strings } from "@/lib/localize-time"; import { useEffect, useState, useRef, useCallback } from "react"; -import { Timeout, errorLogger } from "misc"; +import { Timeout, errorLogger } from "@/lib/misc"; //import { ChatChannelProxy, global_channels, group_channels, tournament_channels } from 'chat_manager'; import { chat_manager, @@ -36,16 +36,16 @@ import { ChannelInformation, resolveChannelInformation, cachedChannelInformation, -} from "chat_manager"; +} from "@/lib/chat_manager"; import { ChatLine } from "./ChatLine"; import { ChatDetails } from "./ChatDetails"; -import { TabCompleteInput } from "TabCompleteInput"; -import { browserHistory } from "ogsHistory"; -import { ObserveGamesComponent } from "ObserveGamesComponent"; -import { profanity_filter } from "profanity_filter"; -import { popover } from "popover"; -import { alert } from "swal_config"; -import { useUser } from "hooks"; +import { TabCompleteInput } from "@/components/TabCompleteInput"; +import { browserHistory } from "@/lib/ogsHistory"; +import { ObserveGamesComponent } from "@/components/ObserveGamesComponent"; +import { profanity_filter } from "@/lib/profanity_filter"; +import { popover } from "@/lib/popover"; +import { alert } from "@/lib/swal_config"; +import { useUser } from "@/lib/hooks"; interface ChatLogProperties { channel: string; diff --git a/src/components/Chat/ChatUsersList.tsx b/src/components/Chat/ChatUsersList.tsx index 7a9643e7d3..362e6f91c4 100644 --- a/src/components/Chat/ChatUsersList.tsx +++ b/src/components/Chat/ChatUsersList.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import * as preferences from "preferences"; -import { Player } from "Player"; -import { _, interpolate } from "translate"; -import { socket } from "sockets"; +import * as preferences from "@/lib/preferences"; +import { Player } from "@/components/Player"; +import { _, interpolate } from "@/lib/translate"; +import { socket } from "@/lib/sockets"; import { useEffect, useState, useCallback } from "react"; -import { Timeout } from "misc"; -import { chat_manager, users_by_rank, ChatChannelProxy } from "chat_manager"; +import { Timeout } from "@/lib/misc"; +import { chat_manager, users_by_rank, ChatChannelProxy } from "@/lib/chat_manager"; interface ChatUsersListProperties { channel: string; diff --git a/src/components/Chat/chat_markup.tsx b/src/components/Chat/chat_markup.tsx index fffa003e5a..79a2be10c7 100644 --- a/src/components/Chat/chat_markup.tsx +++ b/src/components/Chat/chat_markup.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; import { Link } from "react-router-dom"; -import { Player } from "Player"; -import { profanity_filter } from "profanity_filter"; +import { Player } from "@/components/Player"; +import { profanity_filter } from "@/lib/profanity_filter"; export interface TextReplacement { split: RegExp; diff --git a/src/components/Chat/state.ts b/src/components/Chat/state.ts index 25c4016162..8e8072e4a0 100644 --- a/src/components/Chat/state.ts +++ b/src/components/Chat/state.ts @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -import * as data from "data"; -import * as preferences from "preferences"; -import { TypedEventEmitter } from "TypedEventEmitter"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; interface Events { subscription_changed: void; diff --git a/src/components/ChatPresenceIndicator/ChatPresenceIndicator.tsx b/src/components/ChatPresenceIndicator/ChatPresenceIndicator.tsx index fdb1ed0b95..ded8081825 100644 --- a/src/components/ChatPresenceIndicator/ChatPresenceIndicator.tsx +++ b/src/components/ChatPresenceIndicator/ChatPresenceIndicator.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { chat_manager, ChatChannelProxy } from "chat_manager"; +import { _ } from "@/lib/translate"; +import { chat_manager, ChatChannelProxy } from "@/lib/chat_manager"; interface ChatPresenceIndicatorProperties { channel: string; diff --git a/src/components/ChatUserList/ChatUserList.tsx b/src/components/ChatUserList/ChatUserList.tsx index efedd8f19d..1ad009c162 100644 --- a/src/components/ChatUserList/ChatUserList.tsx +++ b/src/components/ChatUserList/ChatUserList.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _, interpolate } from "translate"; -import { chat_manager, ChatChannelProxy } from "chat_manager"; -import * as preferences from "preferences"; -import { Player } from "Player"; +import { _, interpolate } from "@/lib/translate"; +import { chat_manager, ChatChannelProxy } from "@/lib/chat_manager"; +import * as preferences from "@/lib/preferences"; +import { Player } from "@/components/Player"; interface ChatUserListProperties { channel: string; diff --git a/src/components/Clock/Clock.tsx b/src/components/Clock/Clock.tsx index 5b4559002e..778bd66e17 100644 --- a/src/components/Clock/Clock.tsx +++ b/src/components/Clock/Clock.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { useEffect, useState } from "react"; import { Goban, JGOFClockWithTransmitting, JGOFPlayerClock, JGOFTimeControl } from "goban"; -import { _, pgettext, interpolate, ngettext } from "translate"; +import { _, pgettext, interpolate, ngettext } from "@/lib/translate"; type clock_color = "black" | "white" | "stone-removal"; diff --git a/src/components/DismissableMessages/DismissableMessages.tsx b/src/components/DismissableMessages/DismissableMessages.tsx index 024bf69297..282f9f2c34 100644 --- a/src/components/DismissableMessages/DismissableMessages.tsx +++ b/src/components/DismissableMessages/DismissableMessages.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import * as data from "data"; -import { del } from "requests"; -import { DismissableMessagesSchema } from "data_schema"; -import { AutoTranslate } from "AutoTranslate"; -import { UIPush } from "UIPush"; +import * as data from "@/lib/data"; +import { del } from "@/lib/requests"; +import { DismissableMessagesSchema } from "@/lib/data_schema"; +import { AutoTranslate } from "@/components/AutoTranslate"; +import { UIPush } from "@/components/UIPush"; export function DismissableMessages(): JSX.Element | null { const [messages, setMessages] = React.useState( diff --git a/src/components/DismissableNotification/DismissableNotification.tsx b/src/components/DismissableNotification/DismissableNotification.tsx index 0ec3be35de..88db3120f6 100644 --- a/src/components/DismissableNotification/DismissableNotification.tsx +++ b/src/components/DismissableNotification/DismissableNotification.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; interface DismissableNotificationProperties { dismissedKey: string; diff --git a/src/components/Dock/Dock.tsx b/src/components/Dock/Dock.tsx index d65463349a..9d06531777 100644 --- a/src/components/Dock/Dock.tsx +++ b/src/components/Dock/Dock.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import * as preferences from "preferences"; -import { MAX_DOCK_DELAY } from "SettingsCommon"; +import * as preferences from "@/lib/preferences"; +import { MAX_DOCK_DELAY } from "@/lib/SettingsCommon"; interface DockProperties { className?: string; diff --git a/src/components/EmailBanner/EmailBanner.tsx b/src/components/EmailBanner/EmailBanner.tsx index b14b157c58..c83c110506 100644 --- a/src/components/EmailBanner/EmailBanner.tsx +++ b/src/components/EmailBanner/EmailBanner.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { browserHistory } from "ogsHistory"; -import { _ } from "translate"; -import * as data from "data"; -import { Card } from "material"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _ } from "@/lib/translate"; +import * as data from "@/lib/data"; +import { Card } from "@/components/material"; export class EmailBanner extends React.PureComponent { constructor(props: {}) { diff --git a/src/components/Errcode/Errcode.tsx b/src/components/Errcode/Errcode.tsx index a19f75b805..1da4fd4f76 100644 --- a/src/components/Errcode/Errcode.tsx +++ b/src/components/Errcode/Errcode.tsx @@ -18,9 +18,9 @@ /* cspell: disable */ import * as React from "react"; -import { MessageId, MessageObject } from "messages"; +import { MessageId, MessageObject } from "@/lib/messages"; import { GobanMoveErrorMessageObject } from "goban"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; export interface MessageProps { message?: MessageObject; diff --git a/src/components/ErrcodeModal/ErrcodeModal.tsx b/src/components/ErrcodeModal/ErrcodeModal.tsx index 59acf4c134..6d410726d5 100644 --- a/src/components/ErrcodeModal/ErrcodeModal.tsx +++ b/src/components/ErrcodeModal/ErrcodeModal.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; -import { Errcode } from "Errcode"; -import { MessageId } from "messages"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; +import { Errcode } from "@/components/Errcode"; +import { MessageId } from "@/lib/messages"; interface Events {} diff --git a/src/components/ErrorBoundary/ErrorBoundary.tsx b/src/components/ErrorBoundary/ErrorBoundary.tsx index b44c0f5ee0..c44dcb744e 100644 --- a/src/components/ErrorBoundary/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary/ErrorBoundary.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import * as data from "data"; -import { _ } from "translate"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; import * as Sentry from "@sentry/browser"; interface ErrorBoundaryProps { diff --git a/src/components/Experiment/Experiment.tsx b/src/components/Experiment/Experiment.tsx index 228353d4e7..1bf292a91e 100644 --- a/src/components/Experiment/Experiment.tsx +++ b/src/components/Experiment/Experiment.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { useData } from "hooks"; +import { useData } from "@/lib/hooks"; import { Default } from "./Default"; interface ExperimentProps { diff --git a/src/components/Flag/Flag.tsx b/src/components/Flag/Flag.tsx index ccc9f01d22..ed7a0e6a1e 100644 --- a/src/components/Flag/Flag.tsx +++ b/src/components/Flag/Flag.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { cc_to_country_name, getCountryFlagClass, getLanguageFlag } from "translate"; +import { cc_to_country_name, getCountryFlagClass, getLanguageFlag } from "@/lib/translate"; interface FlagProperties { country: string; diff --git a/src/components/FreeTrialBanner/FreeTrialBanner.tsx b/src/components/FreeTrialBanner/FreeTrialBanner.tsx index eef1767d47..41acce293b 100644 --- a/src/components/FreeTrialBanner/FreeTrialBanner.tsx +++ b/src/components/FreeTrialBanner/FreeTrialBanner.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, pgettext } from "translate"; -import { useUser } from "hooks"; -import { LoadingButton } from "LoadingButton"; -import { post } from "requests"; +import * as data from "@/lib/data"; +import { _, pgettext } from "@/lib/translate"; +import { useUser } from "@/lib/hooks"; +import { LoadingButton } from "@/components/LoadingButton"; +import { post } from "@/lib/requests"; import { LearnMore } from "./LearnMore"; -import { openModal } from "Modal"; -//import * as data from "data"; +import { openModal } from "@/components/Modal"; +//import * as data from "@/lib/data"; const DAYS_PER_YEAR = 365.2422; diff --git a/src/components/FreeTrialBanner/LearnMore.tsx b/src/components/FreeTrialBanner/LearnMore.tsx index 0d4fa936ae..d3ea18dd7f 100644 --- a/src/components/FreeTrialBanner/LearnMore.tsx +++ b/src/components/FreeTrialBanner/LearnMore.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal } from "Modal"; +import { _ } from "@/lib/translate"; +import { Modal } from "@/components/Modal"; interface Events {} diff --git a/src/components/FreeTrialSurvey/FreeTrialSurvey.tsx b/src/components/FreeTrialSurvey/FreeTrialSurvey.tsx index 566d6650ad..3772d45936 100644 --- a/src/components/FreeTrialSurvey/FreeTrialSurvey.tsx +++ b/src/components/FreeTrialSurvey/FreeTrialSurvey.tsx @@ -16,25 +16,25 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, current_language } from "translate"; -import { AutoTranslate, auto_translate } from "AutoTranslate"; -import { useUser, useData } from "hooks"; -import { post } from "requests"; -import { LoadingButton } from "LoadingButton"; -import { errorAlerter } from "misc"; -import { toast } from "toast"; +import * as data from "@/lib/data"; +import { _, current_language } from "@/lib/translate"; +import { AutoTranslate, auto_translate } from "@/components/AutoTranslate"; +import { useUser, useData } from "@/lib/hooks"; +import { post } from "@/lib/requests"; +import { LoadingButton } from "@/components/LoadingButton"; +import { errorAlerter } from "@/lib/misc"; +import { toast } from "@/lib/toast"; const letter = ` #### Thank you for trying out the AI reviews and site supporter features! -I hope you enjoyed your trial. As you may or may not know, -Online-Go.com is a very very small company, but we'd love to -grow so we can continue making the site better for go players -all around the world. As such, I, Akita Noek (anoek), lead -developer, president of Online-Go.com, Inc., and general -doer of things that need doing would love to hear how we can -make things better, in particular as it relates to AI reviews +I hope you enjoyed your trial. As you may or may not know, +Online-Go.com is a very very small company, but we'd love to +grow so we can continue making the site better for go players +all around the world. As such, I, Akita Noek (anoek), lead +developer, president of Online-Go.com, Inc., and general +doer of things that need doing would love to hear how we can +make things better, in particular as it relates to AI reviews and site supporter features that might entice you to sign up for a supporter membership. diff --git a/src/components/FriendList/FriendIndicator.tsx b/src/components/FriendList/FriendIndicator.tsx index 3099e55410..d9439b4a54 100644 --- a/src/components/FriendList/FriendIndicator.tsx +++ b/src/components/FriendList/FriendIndicator.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import online_status from "online_status"; -import * as data from "data"; +import online_status from "@/lib/online_status"; +import * as data from "@/lib/data"; import { FriendList } from "./FriendList"; -import { KBShortcut } from "KBShortcut"; -import cached from "cached"; +import { KBShortcut } from "@/components/KBShortcut"; +import cached from "@/lib/cached"; import { setSetShowFriendList } from "./close_friend_list"; const online_subscriptions = {}; diff --git a/src/components/FriendList/FriendList.tsx b/src/components/FriendList/FriendList.tsx index c296bd19f2..db1acc1b2c 100644 --- a/src/components/FriendList/FriendList.tsx +++ b/src/components/FriendList/FriendList.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import { _ } from "translate"; -import online_status from "online_status"; -import * as data from "data"; -import * as preferences from "preferences"; -import { Player } from "Player"; -import cached from "cached"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { _ } from "@/lib/translate"; +import online_status from "@/lib/online_status"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { Player } from "@/components/Player"; +import cached from "@/lib/cached"; +import { PlayerCacheEntry } from "@/lib/player_cache"; export class FriendList extends React.PureComponent<{}, any> { constructor(props: {}) { diff --git a/src/components/GameAcceptModal/GameAcceptModal.tsx b/src/components/GameAcceptModal/GameAcceptModal.tsx index c41a7d4c46..f50f996461 100644 --- a/src/components/GameAcceptModal/GameAcceptModal.tsx +++ b/src/components/GameAcceptModal/GameAcceptModal.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { post } from "requests"; -import { openModal, Modal } from "Modal"; -import { Player, PlayerObjectType } from "Player"; -import { errorAlerter } from "misc"; -import { alert } from "swal_config"; +import { _ } from "@/lib/translate"; +import { post } from "@/lib/requests"; +import { openModal, Modal } from "@/components/Modal"; +import { Player, PlayerObjectType } from "@/components/Player"; +import { errorAlerter } from "@/lib/misc"; +import { alert } from "@/lib/swal_config"; import { ChallengeDetailsReviewPane } from "../ChallengeDetailsReviewPane"; -import { Challenge } from "src/lib/challenge_utils"; +import { Challenge } from "@/lib/challenge_utils"; interface Events {} diff --git a/src/components/GameList/GameList.tsx b/src/components/GameList/GameList.tsx index 4f795b3e75..6e7a6da1da 100644 --- a/src/components/GameList/GameList.tsx +++ b/src/components/GameList/GameList.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import { _, pgettext } from "translate"; -import * as preferences from "preferences"; -import { MiniGoban, MiniGobanProps } from "MiniGoban"; -import { GobanLineSummary } from "GobanLineSummary"; -import { Player } from "Player"; +import { _, pgettext } from "@/lib/translate"; +import * as preferences from "@/lib/preferences"; +import { MiniGoban, MiniGobanProps } from "@/components/MiniGoban"; +import { GobanLineSummary } from "@/components/GobanLineSummary"; +import { Player } from "@/components/Player"; import { JGOFTimeControl, JGOFPauseState, diff --git a/src/components/GobanContainer/GobanContainer.tsx b/src/components/GobanContainer/GobanContainer.tsx index 3c0b166889..eaba6555a5 100644 --- a/src/components/GobanContainer/GobanContainer.tsx +++ b/src/components/GobanContainer/GobanContainer.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import { PersistentElement } from "PersistentElement"; -import { OgsResizeDetector } from "OgsResizeDetector"; +import { PersistentElement } from "@/components/PersistentElement"; +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; import { GobanRenderer, GobanRendererConfig } from "goban"; // Pull this out its own util -import { goban_view_mode } from "Game/util"; -//import { generateGobanHook } from "Game/GameHooks"; +import { goban_view_mode } from "@/views/Game/util"; +//import { generateGobanHook } from "@/views/Game/GameHooks"; -import { usePreference } from "preferences"; +import { usePreference } from "@/lib/preferences"; interface GobanContainerProps { goban?: GobanRenderer; diff --git a/src/components/GobanLineSummary/GobanLineSummary.tsx b/src/components/GobanLineSummary/GobanLineSummary.tsx index 5e5f46d96f..a7b90a9368 100644 --- a/src/components/GobanLineSummary/GobanLineSummary.tsx +++ b/src/components/GobanLineSummary/GobanLineSummary.tsx @@ -17,15 +17,15 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { interpolate } from "translate"; +import { interpolate } from "@/lib/translate"; import { createGoban, GobanRenderer } from "goban"; -import * as data from "data"; -import { rankString } from "rank_utils"; -import { Player } from "Player"; -import { Clock } from "Clock"; -import { GobanInfoStateBase } from "src/lib/types"; +import * as data from "@/lib/data"; +import { rankString } from "@/lib/rank_utils"; +import { Player } from "@/components/Player"; +import { Clock } from "@/components/Clock"; +import { GobanInfoStateBase } from "@/lib/types"; import { LineSummaryTableMode } from "../GameList"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { PlayerCacheEntry } from "@/lib/player_cache"; interface UserType { id: number; diff --git a/src/components/GobanThemePicker/GobanThemePicker.tsx b/src/components/GobanThemePicker/GobanThemePicker.tsx index 021a4014ce..f7b7404962 100644 --- a/src/components/GobanThemePicker/GobanThemePicker.tsx +++ b/src/components/GobanThemePicker/GobanThemePicker.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { Goban, GobanTheme /*, GobanThemeBackgroundCSS */ } from "goban"; -import { getSelectedThemes, usePreference } from "preferences"; -import { PersistentElement } from "PersistentElement"; +import { getSelectedThemes, usePreference } from "@/lib/preferences"; +import { PersistentElement } from "@/components/PersistentElement"; import { Experiment, Variant, Default } from "../Experiment"; import { LineText } from "../misc-ui"; import { Link } from "react-router-dom"; diff --git a/src/components/GroupAutocomplete/GroupAutocomplete.tsx b/src/components/GroupAutocomplete/GroupAutocomplete.tsx index b188d0bb47..db1d8a991a 100644 --- a/src/components/GroupAutocomplete/GroupAutocomplete.tsx +++ b/src/components/GroupAutocomplete/GroupAutocomplete.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { get, abort_requests_in_flight } from "requests"; -import * as Autosuggest from "react-autosuggest"; +import { _ } from "@/lib/translate"; +import { get, abort_requests_in_flight } from "@/lib/requests"; +import Autosuggest from "react-autosuggest"; interface GroupAutocompleteProperties { onComplete: (group: Suggestion | null) => void; diff --git a/src/components/IncidentReportTracker/IncidentReportCard.tsx b/src/components/IncidentReportTracker/IncidentReportCard.tsx index 424f905818..b07e03da65 100644 --- a/src/components/IncidentReportTracker/IncidentReportCard.tsx +++ b/src/components/IncidentReportTracker/IncidentReportCard.tsx @@ -22,21 +22,21 @@ import * as React from "react"; -import * as moment from "moment"; -import { post } from "requests"; +import moment from "moment"; +import { post } from "@/lib/requests"; import { Link } from "react-router-dom"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; -import { Player } from "Player"; +import { Player } from "@/components/Player"; -import { errorAlerter } from "misc"; -import { AutoTranslate } from "AutoTranslate"; -import { Report } from "report_util"; -import { useUser } from "hooks"; -import { report_categories } from "Report"; -import { openReportedConversationModal } from "ReportedConversationModal"; +import { errorAlerter } from "@/lib/misc"; +import { AutoTranslate } from "@/components/AutoTranslate"; +import { Report } from "@/lib/report_util"; +import { useUser } from "@/lib/hooks"; +import { report_categories } from "@/components/Report"; +import { openReportedConversationModal } from "@/components/ReportedConversationModal"; function getReportType(report: Report): string { if (report.report_type === "appeal") { diff --git a/src/components/IncidentReportTracker/IncidentReportTracker.tsx b/src/components/IncidentReportTracker/IncidentReportTracker.tsx index a521125ce4..cfcde40b47 100644 --- a/src/components/IncidentReportTracker/IncidentReportTracker.tsx +++ b/src/components/IncidentReportTracker/IncidentReportTracker.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import * as preferences from "preferences"; -import * as data from "data"; +import * as preferences from "@/lib/preferences"; +import * as data from "@/lib/data"; import { Link, useNavigate } from "react-router-dom"; -import { alert } from "swal_config"; -import { pgettext } from "translate"; -import { post } from "requests"; -import { usePreference } from "preferences"; - -import { ignore, errorAlerter } from "misc"; -import { report_manager } from "report_manager"; -import { Report } from "report_util"; -import { useRefresh, useUser } from "hooks"; +import { alert } from "@/lib/swal_config"; +import { pgettext } from "@/lib/translate"; +import { post } from "@/lib/requests"; +import { usePreference } from "@/lib/preferences"; + +import { ignore, errorAlerter } from "@/lib/misc"; +import { report_manager } from "@/lib/report_manager"; +import { Report } from "@/lib/report_util"; +import { useRefresh, useUser } from "@/lib/hooks"; import * as DynamicHelp from "react-dynamic-help"; import { IncidentReportCard } from "./IncidentReportCard"; @@ -44,6 +44,7 @@ export function IncidentReportTracker(): JSX.Element | null { const { registerTargetItem, triggerFlow, signalUsed } = React.useContext(DynamicHelp.Api); const { ref: incident_report_indicator, active: incidentReportIndicatorActive } = registerTargetItem("incident-report-indicator"); + const { ref: hidden_incident_report_indicator } = registerTargetItem( "hidden-incident-report-indicator", ); diff --git a/src/components/JosekiAdmin/JosekiAdmin.tsx b/src/components/JosekiAdmin/JosekiAdmin.tsx index 9657df98ff..9c073619b0 100644 --- a/src/components/JosekiAdmin/JosekiAdmin.tsx +++ b/src/components/JosekiAdmin/JosekiAdmin.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import { _, interpolate, pgettext } from "translate"; -import { get, post, put } from "requests"; +import { _, interpolate, pgettext } from "@/lib/translate"; +import { get, post, put } from "@/lib/requests"; import ReactTable from "react-table"; import selectTableHOC from "react-table/lib/hoc/selectTable"; -import { openModal } from "Modal"; -import { Player } from "Player"; +import { openModal } from "@/components/Modal"; +import { Player } from "@/components/Player"; -import { JosekiPermissionsPanel } from "JosekiPermissionsPanel"; -import { JosekiPageVisits, JosekiStatsModal } from "JosekiStatsModal"; +import { JosekiPermissionsPanel } from "@/components/JosekiPermissionsPanel"; +import { JosekiPageVisits, JosekiStatsModal } from "@/components/JosekiStatsModal"; interface JosekiAdminProps { server_url: string; diff --git a/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx b/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx index 2b33f02921..271b876265 100644 --- a/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx +++ b/src/components/JosekiPermissionsPanel/JosekiPermissionsPanel.tsx @@ -17,10 +17,10 @@ import * as React from "react"; -import * as data from "data"; -import { get, put } from "requests"; +import * as data from "@/lib/data"; +import { get, put } from "@/lib/requests"; -import { Player } from "Player"; +import { Player } from "@/components/Player"; interface JosekiAdminProps { server_url: string; diff --git a/src/components/JosekiSourceModal/JosekiSourceModal.tsx b/src/components/JosekiSourceModal/JosekiSourceModal.tsx index a5457fce29..1c39f8f34c 100644 --- a/src/components/JosekiSourceModal/JosekiSourceModal.tsx +++ b/src/components/JosekiSourceModal/JosekiSourceModal.tsx @@ -18,8 +18,8 @@ import * as React from "react"; import * as ValidUrl from "valid-url"; -import { _ } from "translate"; -import { Modal } from "Modal"; +import { _ } from "@/lib/translate"; +import { Modal } from "@/components/Modal"; interface Events {} diff --git a/src/components/JosekiStatsModal/JosekiStatsModal.tsx b/src/components/JosekiStatsModal/JosekiStatsModal.tsx index 6e645d2449..8c93b68a10 100644 --- a/src/components/JosekiStatsModal/JosekiStatsModal.tsx +++ b/src/components/JosekiStatsModal/JosekiStatsModal.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import * as moment from "moment"; +import moment from "moment"; import { ResponsiveLine } from "@nivo/line"; -import * as data from "data"; -import { _ } from "translate"; -import { Modal } from "Modal"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; +import { Modal } from "@/components/Modal"; interface Events {} diff --git a/src/components/JosekiTagSelector/JosekiTagSelector.tsx b/src/components/JosekiTagSelector/JosekiTagSelector.tsx index 95a06ea5f2..66e7f24536 100644 --- a/src/components/JosekiTagSelector/JosekiTagSelector.tsx +++ b/src/components/JosekiTagSelector/JosekiTagSelector.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; import Select, { MultiValue } from "react-select"; diff --git a/src/components/JosekiVariationFilter/JosekiVariationFilter.tsx b/src/components/JosekiVariationFilter/JosekiVariationFilter.tsx index e0437af152..12bb8df36c 100644 --- a/src/components/JosekiVariationFilter/JosekiVariationFilter.tsx +++ b/src/components/JosekiVariationFilter/JosekiVariationFilter.tsx @@ -17,13 +17,13 @@ import * as React from "react"; import * as ReactSelect from "react-select"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; import * as DynamicHelp from "react-dynamic-help"; -import * as player_cache from "player_cache"; +import * as player_cache from "@/lib/player_cache"; import { JosekiTagSelector, JosekiTag } from "../JosekiTagSelector"; -import { PlayerCacheEntry } from "player_cache"; -import { get } from "requests"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import { get } from "@/lib/requests"; export type JosekiFilter = { contributor?: number; tags: JosekiTag[]; source?: number }; diff --git a/src/components/KBShortcut/KBShortcut.tsx b/src/components/KBShortcut/KBShortcut.tsx index 62373bf888..dd34e65ac0 100644 --- a/src/components/KBShortcut/KBShortcut.tsx +++ b/src/components/KBShortcut/KBShortcut.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; let binding_id = 0; diff --git a/src/components/LadderComponent/LadderComponent.tsx b/src/components/LadderComponent/LadderComponent.tsx index 439fc3ce7d..494e1bdddd 100644 --- a/src/components/LadderComponent/LadderComponent.tsx +++ b/src/components/LadderComponent/LadderComponent.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Player } from "Player"; -import { PaginatedTable } from "PaginatedTable"; -import { useResizeDetector } from "OgsResizeDetector"; +import { _ } from "@/lib/translate"; +import { Player } from "@/components/Player"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import { useResizeDetector } from "@/components/OgsResizeDetector"; interface LadderComponentProperties { ladderId: number; diff --git a/src/components/LanguagePicker/LanguagePicker.tsx b/src/components/LanguagePicker/LanguagePicker.tsx index bd0270a933..efebaa7bb0 100644 --- a/src/components/LanguagePicker/LanguagePicker.tsx +++ b/src/components/LanguagePicker/LanguagePicker.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { _, setCurrentLanguage, current_language, languages } from "translate"; -import { Modal, openModal } from "Modal"; -import * as preferences from "preferences"; +import { _, setCurrentLanguage, current_language, languages } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; +import * as preferences from "@/lib/preferences"; interface Events {} diff --git a/src/components/Markdown/Markdown.tsx b/src/components/Markdown/Markdown.tsx index b44ed183c9..d741ebaf9c 100644 --- a/src/components/Markdown/Markdown.tsx +++ b/src/components/Markdown/Markdown.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import * as markdown_it from "markdown-it"; -import * as sanitizeHtml from "sanitize-html"; -//import * as moment from "moment"; -import { profanity_filter } from "profanity_filter"; -import { localize_time_strings } from "localize-time"; +import markdownit from "markdown-it"; +import sanitizeHtml from "sanitize-html"; +//import moment from "moment"; +import { profanity_filter } from "@/lib/profanity_filter"; +import { localize_time_strings } from "@/lib/localize-time"; interface MarkdownProps { source?: string; @@ -29,7 +29,7 @@ interface MarkdownProps { interface MarkdownState {} -const md = markdown_it({ +const md = markdownit({ html: true, linkify: true, typographer: true, diff --git a/src/components/MergeReportModal/MergeReportModal.tsx b/src/components/MergeReportModal/MergeReportModal.tsx index ae6378225c..c31c4abdd8 100644 --- a/src/components/MergeReportModal/MergeReportModal.tsx +++ b/src/components/MergeReportModal/MergeReportModal.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; interface Events {} diff --git a/src/components/MiniGoban/MiniGoban.tsx b/src/components/MiniGoban/MiniGoban.tsx index 1e4128ce57..1e55759eb9 100644 --- a/src/components/MiniGoban/MiniGoban.tsx +++ b/src/components/MiniGoban/MiniGoban.tsx @@ -17,19 +17,19 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { npgettext, interpolate } from "translate"; -import * as moment from "moment"; -import * as preferences from "preferences"; +import { npgettext, interpolate } from "@/lib/translate"; +import moment from "moment"; +import * as preferences from "@/lib/preferences"; import { GobanRenderer, JGOFMove, createGoban } from "goban"; -import * as data from "data"; -import { PersistentElement } from "PersistentElement"; -import { getUserRating, PROVISIONAL_RATING_CUTOFF } from "rank_utils"; -import { Clock } from "Clock"; -import { fetch } from "player_cache"; -import { getGameResultText } from "misc"; -import { getEm10Width, getWindowWidth } from "lib/device"; -import { PlayerCacheEntry } from "player_cache"; -import { usePreference } from "preferences"; +import * as data from "@/lib/data"; +import { PersistentElement } from "@/components/PersistentElement"; +import { getUserRating, PROVISIONAL_RATING_CUTOFF } from "@/lib/rank_utils"; +import { Clock } from "@/components/Clock"; +import { fetch } from "@/lib/player_cache"; +import { getGameResultText } from "@/lib/misc"; +import { getEm10Width, getWindowWidth } from "@/lib/device"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import { usePreference } from "@/lib/preferences"; export interface MiniGobanProps { game_id?: number; diff --git a/src/components/ModNoteModal/ModNoteModal.tsx b/src/components/ModNoteModal/ModNoteModal.tsx index 06c01e6ffb..9dd6dda041 100644 --- a/src/components/ModNoteModal/ModNoteModal.tsx +++ b/src/components/ModNoteModal/ModNoteModal.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import { browserHistory } from "ogsHistory"; -import { put } from "requests"; -import { errorAlerter } from "misc"; -import * as player_cache from "player_cache"; -import { _ } from "translate"; +import { browserHistory } from "@/lib/ogsHistory"; +import { put } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import * as player_cache from "@/lib/player_cache"; +import { _ } from "@/lib/translate"; -import { Modal, openModal } from "Modal"; +import { Modal, openModal } from "@/components/Modal"; interface Events {} diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index 31898a5090..a264b15bd5 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -17,7 +17,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom/client"; -import { TypedEventEmitterPureComponent } from "TypedEventEmitterPureComponent"; +import { TypedEventEmitterPureComponent } from "@/components/TypedEventEmitterPureComponent"; let current_modal: any = null; diff --git a/src/components/ModerateUser/ModerateUser.tsx b/src/components/ModerateUser/ModerateUser.tsx index 9437d530fb..9f6dbddef1 100644 --- a/src/components/ModerateUser/ModerateUser.tsx +++ b/src/components/ModerateUser/ModerateUser.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, pgettext } from "translate"; -import { put, get, del } from "requests"; -import { errorAlerter } from "misc"; -import { proRankList } from "rank_utils"; -import { Modal, openModal } from "Modal"; -import { PlayerCacheEntry, lookup } from "player_cache"; -import { MODERATOR_POWERS } from "moderation"; +import * as data from "@/lib/data"; +import { _, pgettext } from "@/lib/translate"; +import { put, get, del } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { proRankList } from "@/lib/rank_utils"; +import { Modal, openModal } from "@/components/Modal"; +import { PlayerCacheEntry, lookup } from "@/lib/player_cache"; +import { MODERATOR_POWERS } from "@/lib/moderation"; interface Events {} @@ -31,8 +31,8 @@ interface ModerateUserProperties { playerId?: number; } -import { alert } from "swal_config"; -import { ModerationOfferControl } from "ModerationOfferControl"; +import { alert } from "@/lib/swal_config"; +import { ModerationOfferControl } from "@/components/ModerationOfferControl"; const pro_ranks = proRankList(false); diff --git a/src/components/ModerationOffer/ModerationOffer.tsx b/src/components/ModerationOffer/ModerationOffer.tsx index 91d2d5a7e3..4ee3031f9f 100644 --- a/src/components/ModerationOffer/ModerationOffer.tsx +++ b/src/components/ModerationOffer/ModerationOffer.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { openModerationOfferModal } from "./ModerationOfferModal"; diff --git a/src/components/ModerationOffer/ModerationOfferModal.tsx b/src/components/ModerationOffer/ModerationOfferModal.tsx index a49220a6e9..867cb0eb46 100644 --- a/src/components/ModerationOffer/ModerationOfferModal.tsx +++ b/src/components/ModerationOffer/ModerationOfferModal.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import { pgettext } from "translate"; -import { openModal, Modal } from "Modal"; -import { alert } from "swal_config"; -import { patch } from "requests"; +import { pgettext } from "@/lib/translate"; +import { openModal, Modal } from "@/components/Modal"; +import { alert } from "@/lib/swal_config"; +import { patch } from "@/lib/requests"; -import { errorAlerter } from "misc"; -import { MODERATOR_POWERS, MOD_POWER_NAMES } from "moderation"; +import { errorAlerter } from "@/lib/misc"; +import { MODERATOR_POWERS, MOD_POWER_NAMES } from "@/lib/moderation"; interface Events {} diff --git a/src/components/ModerationOfferControl/ModerationOfferControl.tsx b/src/components/ModerationOfferControl/ModerationOfferControl.tsx index 25132da102..9f1a79d709 100644 --- a/src/components/ModerationOfferControl/ModerationOfferControl.tsx +++ b/src/components/ModerationOfferControl/ModerationOfferControl.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; interface ModerationOfferControlProps { ability: string; // Title/label for this power diff --git a/src/components/NavBar/NavBar.tsx b/src/components/NavBar/NavBar.tsx index 9a01456d65..28cb87a86e 100644 --- a/src/components/NavBar/NavBar.tsx +++ b/src/components/NavBar/NavBar.tsx @@ -19,26 +19,26 @@ import * as React from "react"; import { Link, useLocation } from "react-router-dom"; import * as DynamicHelp from "react-dynamic-help"; -import * as data from "data"; - -import { _, pgettext } from "translate"; -import { PlayerIcon } from "PlayerIcon"; -import { LineText } from "misc-ui"; -import { createDemoBoard } from "ChallengeModal"; -import { LanguagePicker } from "LanguagePicker"; -import { GobanThemePicker } from "GobanThemePicker"; -import { IncidentReportTracker } from "IncidentReportTracker"; -import { KBShortcut } from "KBShortcut"; -import { NotificationList, notification_manager } from "Notifications"; -import { TurnIndicator } from "TurnIndicator"; -import { NotificationIndicator } from "NotificationIndicator"; -import { TournamentIndicator } from "Announcements"; -import { FriendIndicator } from "FriendList"; -import { ChatIndicator } from "Chat"; -import { GoTVIndicator } from "GoTV"; - -import { logout } from "auth"; -import { useUser, useData } from "hooks"; +import * as data from "@/lib/data"; + +import { _, pgettext } from "@/lib/translate"; +import { PlayerIcon } from "@/components/PlayerIcon"; +import { LineText } from "@/components/misc-ui"; +import { createDemoBoard } from "@/components/ChallengeModal"; +import { LanguagePicker } from "@/components/LanguagePicker"; +import { GobanThemePicker } from "@/components/GobanThemePicker"; +import { IncidentReportTracker } from "@/components/IncidentReportTracker"; +import { KBShortcut } from "@/components/KBShortcut"; +import { NotificationList, notification_manager } from "@/components/Notifications"; +import { TurnIndicator } from "@/components/TurnIndicator"; +import { NotificationIndicator } from "@/components/NotificationIndicator"; +import { TournamentIndicator } from "@/components/Announcements"; +import { FriendIndicator } from "@/components/FriendList"; +import { ChatIndicator } from "@/components/Chat"; +import { GoTVIndicator } from "@/views/GoTV"; + +import { logout } from "@/lib/auth"; +import { useUser, useData } from "@/lib/hooks"; import { OmniSearch } from "./OmniSearch"; const body = $(document.body); diff --git a/src/components/NavBar/OmniSearch.tsx b/src/components/NavBar/OmniSearch.tsx index e881a3b15d..939b5930f9 100644 --- a/src/components/NavBar/OmniSearch.tsx +++ b/src/components/NavBar/OmniSearch.tsx @@ -16,12 +16,12 @@ */ import * as React from "react"; -import * as player_cache from "player_cache"; -import { get, abort_requests_in_flight } from "requests"; -import { _ } from "translate"; +import * as player_cache from "@/lib/player_cache"; +import { get, abort_requests_in_flight } from "@/lib/requests"; +import { _ } from "@/lib/translate"; import { Link } from "react-router-dom"; -import { Player } from "Player"; -import { ignore } from "misc"; +import { Player } from "@/components/Player"; +import { ignore } from "@/lib/misc"; interface OmniSearchProperties { search: string; diff --git a/src/components/NetworkStatus/NetworkStatus.tsx b/src/components/NetworkStatus/NetworkStatus.tsx index 2eba072013..ff1dcc07d3 100644 --- a/src/components/NetworkStatus/NetworkStatus.tsx +++ b/src/components/NetworkStatus/NetworkStatus.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import * as preferences from "preferences"; -import { _ } from "translate"; -import { socket } from "sockets"; -import { lookingAtOurLiveGame } from "TimeControl/util"; +import * as preferences from "@/lib/preferences"; +import { _ } from "@/lib/translate"; +import { socket } from "@/lib/sockets"; +import { lookingAtOurLiveGame } from "@/components/TimeControl/util"; //interface NetworkStatusProps {} diff --git a/src/components/NewUserRankChooser/NewUserRankChooser.tsx b/src/components/NewUserRankChooser/NewUserRankChooser.tsx index 6a28945c57..5ee87e7d6e 100644 --- a/src/components/NewUserRankChooser/NewUserRankChooser.tsx +++ b/src/components/NewUserRankChooser/NewUserRankChooser.tsx @@ -17,10 +17,10 @@ import * as React from "react"; -import { pgettext } from "translate"; -import { put } from "requests"; -import { errorAlerter } from "misc"; -import { useUser } from "hooks"; +import { pgettext } from "@/lib/translate"; +import { put } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { useUser } from "@/lib/hooks"; interface NewUserRankChooserProps { show_skip?: boolean; diff --git a/src/components/NotesModal/NotesModal.tsx b/src/components/NotesModal/NotesModal.tsx index 866cce3397..7abbdaacff 100644 --- a/src/components/NotesModal/NotesModal.tsx +++ b/src/components/NotesModal/NotesModal.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal } from "Modal"; +import { _ } from "@/lib/translate"; +import { Modal } from "@/components/Modal"; interface Events {} diff --git a/src/components/NotificationIndicator/NotificationIndicator.tsx b/src/components/NotificationIndicator/NotificationIndicator.tsx index 4ff7f7fb27..88b0806301 100644 --- a/src/components/NotificationIndicator/NotificationIndicator.tsx +++ b/src/components/NotificationIndicator/NotificationIndicator.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { notification_manager } from "Notifications"; -import { _ } from "translate"; +import { notification_manager } from "@/components/Notifications"; +import { _ } from "@/lib/translate"; export function NotificationIndicator({ onClick }: { onClick: () => void }): JSX.Element { const [count, setCount] = React.useState( diff --git a/src/components/Notifications/NotificationManager.tsx b/src/components/Notifications/NotificationManager.tsx index 78043f8e29..70100cdcc0 100644 --- a/src/components/Notifications/NotificationManager.tsx +++ b/src/components/Notifications/NotificationManager.tsx @@ -16,20 +16,20 @@ */ import * as React from "react"; -import { socket, time_since_connect } from "sockets"; -import * as data from "data"; -import * as preferences from "preferences"; -import { _, interpolate } from "translate"; -import { browserHistory } from "ogsHistory"; - -import { FabX, FabCheck } from "material"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import { toast } from "toast"; -import { sfx } from "sfx"; - -import { ogs_has_focus, getCurrentGameId, shouldOpenNewTab } from "misc"; -import { lookingAtOurLiveGame } from "TimeControl/util"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { socket, time_since_connect } from "@/lib/sockets"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { _, interpolate } from "@/lib/translate"; +import { browserHistory } from "@/lib/ogsHistory"; + +import { FabX, FabCheck } from "@/components/material"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { toast } from "@/lib/toast"; +import { sfx } from "@/lib/sfx"; + +import { ogs_has_focus, getCurrentGameId, shouldOpenNewTab } from "@/lib/misc"; +import { lookingAtOurLiveGame } from "@/components/TimeControl/util"; +import { PlayerCacheEntry } from "@/lib/player_cache"; import { GameListEntry } from "goban"; //declare let Notification: any; diff --git a/src/components/Notifications/Notifications.tsx b/src/components/Notifications/Notifications.tsx index 8753245a9d..6814427dfb 100644 --- a/src/components/Notifications/Notifications.tsx +++ b/src/components/Notifications/Notifications.tsx @@ -18,20 +18,20 @@ /* cspell:disable */ import * as React from "react"; -import * as data from "data"; - -import { _, interpolate, pgettext } from "translate"; - -import { post, del } from "requests"; -import { browserHistory } from "ogsHistory"; -import { challenge_text_description, ChallengeDetails } from "ChallengeModal"; -import { Player } from "Player"; -import { FabX, FabCheck } from "material"; -import { deepEqual } from "misc"; -import { isLiveGame, durationString } from "TimeControl"; -import { MODERATOR_POWERS, MOD_POWER_NAMES } from "moderation"; +import * as data from "@/lib/data"; + +import { _, interpolate, pgettext } from "@/lib/translate"; + +import { post, del } from "@/lib/requests"; +import { browserHistory } from "@/lib/ogsHistory"; +import { challenge_text_description, ChallengeDetails } from "@/components/ChallengeModal"; +import { Player } from "@/components/Player"; +import { FabX, FabCheck } from "@/components/material"; +import { deepEqual } from "@/lib/misc"; +import { isLiveGame, durationString } from "@/components/TimeControl"; +import { MODERATOR_POWERS, MOD_POWER_NAMES } from "@/lib/moderation"; import { notification_manager, Notification } from "./NotificationManager"; -import { ModerationOffer } from "ModerationOffer"; +import { ModerationOffer } from "@/components/ModerationOffer"; export function NotificationList(): JSX.Element { const [, setCount] = React.useState( diff --git a/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx b/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx index f297b2ff3f..296653d372 100644 --- a/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx +++ b/src/components/ObserveGamesComponent/ObserveGamesComponent.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import * as data from "data"; -import * as preferences from "preferences"; -import { _, pgettext, interpolate } from "translate"; -import { dup } from "misc"; -import { GameList } from "GameList"; -import { ActiveAnnouncements } from "Announcements"; -import { socket } from "sockets"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { dup } from "@/lib/misc"; +import { GameList } from "@/components/GameList"; +import { ActiveAnnouncements } from "@/components/Announcements"; +import { socket } from "@/lib/sockets"; interface ObserveGamesComponentProperties { announcements: boolean; diff --git a/src/components/OgsHelpProvider/OgsHelpProvider.tsx b/src/components/OgsHelpProvider/OgsHelpProvider.tsx index 21beb39ac7..f94f9c42b3 100644 --- a/src/components/OgsHelpProvider/OgsHelpProvider.tsx +++ b/src/components/OgsHelpProvider/OgsHelpProvider.tsx @@ -18,13 +18,13 @@ Copyright (c) Online-Go.com. */ import * as React from "react"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; -import * as data from "data"; +import * as data from "@/lib/data"; import { HelpProvider, HelpPopupDictionary } from "react-dynamic-help"; import * as DynamicHelp from "react-dynamic-help"; -import { useIsDesktop, useUser } from "hooks"; +import { useIsDesktop, useUser } from "@/lib/hooks"; const helpPopupDictionary: HelpPopupDictionary = { "Skip this topic": pgettext("A button to dismiss a help popup topic", "Skip this topic"), diff --git a/src/components/PaginatedTable/PaginatedTable.styl b/src/components/PaginatedTable/PaginatedTable.styl index 3450936d05..b1af637ae3 100644 --- a/src/components/PaginatedTable/PaginatedTable.styl +++ b/src/components/PaginatedTable/PaginatedTable.styl @@ -104,18 +104,15 @@ margin-top: 1rem; .left { - display: flex; + display: inline-block; flex:1; - align-items: center; input { //font-size: 0.7em; padding: 0; width: 2rem; - text-align: right; + text-align: left; border: 0; - margin-left: 0.25rem; - margin-right: 0.5rem; - outline: none; + margin-left: 0.5rem; //border-bottom: 1px solid; //background-color: transparent; //themed color fg @@ -130,7 +127,7 @@ //font-size: 0.7em; min-width: 0.8rem; text-align: right; - margin-right: 1rem; + margin-right: 0.5rem; } .fa { diff --git a/src/components/PaginatedTable/PaginatedTable.tsx b/src/components/PaginatedTable/PaginatedTable.tsx index f97ccdd7cd..c6dad39339 100644 --- a/src/components/PaginatedTable/PaginatedTable.tsx +++ b/src/components/PaginatedTable/PaginatedTable.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { post, get } from "requests"; -import * as data from "data"; +import { _ } from "@/lib/translate"; +import { post, get } from "@/lib/requests"; +import * as data from "@/lib/data"; import { UIPush } from "../UIPush"; interface PaginatedTableColumnProperties { diff --git a/src/components/PaymentProblemBanner/PaymentProblemBanner.tsx b/src/components/PaymentProblemBanner/PaymentProblemBanner.tsx index 56ed9fdf63..50b4111951 100644 --- a/src/components/PaymentProblemBanner/PaymentProblemBanner.tsx +++ b/src/components/PaymentProblemBanner/PaymentProblemBanner.tsx @@ -17,10 +17,10 @@ import * as React from "react"; import { useNavigate } from "react-router-dom"; -import { _ } from "translate"; -import { Card } from "material"; -import { useUser, useData } from "hooks"; -import { PaymentProblem } from "data_schema"; +import { _ } from "@/lib/translate"; +import { Card } from "@/components/material"; +import { useUser, useData } from "@/lib/hooks"; +import { PaymentProblem } from "@/lib/data_schema"; export function PaymentProblemBanner(): JSX.Element | null { const user = useUser(); diff --git a/src/components/Player/Player.tsx b/src/components/Player/Player.tsx index 97cb13c6c3..80887e146f 100644 --- a/src/components/Player/Player.tsx +++ b/src/components/Player/Player.tsx @@ -16,20 +16,20 @@ */ import * as React from "react"; -import { browserHistory } from "ogsHistory"; +import { browserHistory } from "@/lib/ogsHistory"; //import { useNavigate } from "react-router-dom"; -import * as data from "data"; -import { shouldOpenNewTab, errorLogger, unicodeFilter } from "misc"; -import { rankString, getUserRating, PROVISIONAL_RATING_CUTOFF } from "rank_utils"; -import { close_all_popovers, popover } from "popover"; -import { close_friend_list } from "FriendList/close_friend_list"; +import * as data from "@/lib/data"; +import { shouldOpenNewTab, errorLogger, unicodeFilter } from "@/lib/misc"; +import { rankString, getUserRating, PROVISIONAL_RATING_CUTOFF } from "@/lib/rank_utils"; +import { close_all_popovers, popover } from "@/lib/popover"; +import { close_friend_list } from "@/components/FriendList/close_friend_list"; import { PlayerDetails } from "./PlayerDetails"; -import { openPlayerNotesModal } from "PlayerNotesModal"; -import { Flag } from "Flag"; -import { PlayerIcon } from "PlayerIcon"; -import * as player_cache from "player_cache"; -import * as preferences from "preferences"; -import online_status from "online_status"; +import { openPlayerNotesModal } from "@/components/PlayerNotesModal"; +import { Flag } from "@/components/Flag"; +import { PlayerIcon } from "@/components/PlayerIcon"; +import * as player_cache from "@/lib/player_cache"; +import * as preferences from "@/lib/preferences"; +import online_status from "@/lib/online_status"; /* There are cases where what we are handed is some odd looking dirty data. We * should probably start warning about remaining uses of these fields and then diff --git a/src/components/Player/PlayerDetails.tsx b/src/components/Player/PlayerDetails.tsx index 40788305a1..60a4151129 100644 --- a/src/components/Player/PlayerDetails.tsx +++ b/src/components/Player/PlayerDetails.tsx @@ -16,30 +16,30 @@ */ import * as React from "react"; -import { toast } from "toast"; -import { browserHistory } from "ogsHistory"; -import { _, pgettext } from "translate"; -import { post } from "requests"; -import { shouldOpenNewTab, errorAlerter, ignore } from "misc"; -import { getUserRating, humble_rating } from "rank_utils"; -import * as player_cache from "player_cache"; -import { icon_size_url } from "PlayerIcon"; -import { socket } from "sockets"; -import * as data from "data"; -import { close_all_popovers } from "popover"; -import { Flag } from "Flag"; -import { ban, shadowban, remove_shadowban, remove_ban } from "Moderator/ban_functions"; -import { challenge } from "ChallengeModal"; -import { getPrivateChat } from "PrivateChat"; -import { openBlockPlayerControls } from "BlockPlayer"; +import { toast } from "@/lib/toast"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, pgettext } from "@/lib/translate"; +import { post } from "@/lib/requests"; +import { shouldOpenNewTab, errorAlerter, ignore } from "@/lib/misc"; +import { getUserRating, humble_rating } from "@/lib/rank_utils"; +import * as player_cache from "@/lib/player_cache"; +import { icon_size_url } from "@/components/PlayerIcon"; +import { socket } from "@/lib/sockets"; +import * as data from "@/lib/data"; +import { close_all_popovers } from "@/lib/popover"; +import { Flag } from "@/components/Flag"; +import { ban, shadowban, remove_shadowban, remove_ban } from "@/views/Moderator/ban_functions"; +import { challenge } from "@/components/ChallengeModal"; +import { getPrivateChat } from "@/components/PrivateChat"; +import { openBlockPlayerControls } from "@/components/BlockPlayer"; import { Player } from "./Player"; -import * as preferences from "preferences"; -import { close_friend_list } from "FriendList/close_friend_list"; -import cached from "cached"; -import { openPlayerNotesModal } from "PlayerNotesModal"; -import { alert } from "swal_config"; -import { PlayerCacheEntry } from "player_cache"; -import { openReport } from "Report"; +import * as preferences from "@/lib/preferences"; +import { close_friend_list } from "@/components/FriendList/close_friend_list"; +import cached from "@/lib/cached"; +import { openPlayerNotesModal } from "@/components/PlayerNotesModal"; +import { alert } from "@/lib/swal_config"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import { openReport } from "@/components/Report"; interface PlayerDetailsProperties { playerId: number; diff --git a/src/components/PlayerAutocomplete/PlayerAutocomplete.tsx b/src/components/PlayerAutocomplete/PlayerAutocomplete.tsx index 391dd82b1c..f79fa42d78 100644 --- a/src/components/PlayerAutocomplete/PlayerAutocomplete.tsx +++ b/src/components/PlayerAutocomplete/PlayerAutocomplete.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { get, abort_requests_in_flight } from "requests"; -import * as player_cache from "player_cache"; -import * as Autosuggest from "react-autosuggest"; -import { IdType } from "src/lib/types"; +import { _ } from "@/lib/translate"; +import { get, abort_requests_in_flight } from "@/lib/requests"; +import * as player_cache from "@/lib/player_cache"; +import Autosuggest from "react-autosuggest"; +import { IdType } from "@/lib/types"; interface PlayerAutocompleteProperties { onComplete: (user: player_cache.PlayerCacheEntry | null) => void; diff --git a/src/components/PlayerIcon/PlayerIcon.tsx b/src/components/PlayerIcon/PlayerIcon.tsx index bb67f425ca..cedaf23aff 100644 --- a/src/components/PlayerIcon/PlayerIcon.tsx +++ b/src/components/PlayerIcon/PlayerIcon.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import * as player_cache from "player_cache"; -import { errorLogger } from "misc"; -import { player_is_ignored } from "BlockPlayer"; +import * as player_cache from "@/lib/player_cache"; +import { errorLogger } from "@/lib/misc"; +import { player_is_ignored } from "@/components/BlockPlayer"; interface PlayerIconProps { id?: number; diff --git a/src/components/PlayerNotesModal/PlayerNotesModal.tsx b/src/components/PlayerNotesModal/PlayerNotesModal.tsx index 11852df20b..be36ea4ee2 100644 --- a/src/components/PlayerNotesModal/PlayerNotesModal.tsx +++ b/src/components/PlayerNotesModal/PlayerNotesModal.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; -import * as data from "data"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; +import * as data from "@/lib/data"; interface Events {} diff --git a/src/components/PrivateChat/PrivateChat.tsx b/src/components/PrivateChat/PrivateChat.tsx index 8b9048491a..471fe9a780 100644 --- a/src/components/PrivateChat/PrivateChat.tsx +++ b/src/components/PrivateChat/PrivateChat.tsx @@ -15,21 +15,21 @@ * along with this program. If not, see . */ -import { socket } from "sockets"; -import { challenge } from "ChallengeModal"; -import { createModeratorNote } from "ModNoteModal"; -import { _, pgettext, interpolate } from "translate"; -import * as data from "data"; -import ITC from "ITC"; -import { splitOnBytes, unicodeFilter } from "misc"; -import { profanity_filter } from "profanity_filter"; -import { player_is_ignored } from "BlockPlayer"; -import { emitNotification } from "Notifications/NotificationManager"; -import { PlayerCacheEntry } from "player_cache"; -import * as player_cache from "player_cache"; -import online_status from "online_status"; -import { openReport } from "Report"; -import { alert } from "swal_config"; +import { socket } from "@/lib/sockets"; +import { challenge } from "@/components/ChallengeModal"; +import { createModeratorNote } from "@/components/ModNoteModal"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import * as data from "@/lib/data"; +import ITC from "@/lib/ITC"; +import { splitOnBytes, unicodeFilter } from "@/lib/misc"; +import { profanity_filter } from "@/lib/profanity_filter"; +import { player_is_ignored } from "@/components/BlockPlayer"; +import { emitNotification } from "@/components/Notifications/NotificationManager"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import * as player_cache from "@/lib/player_cache"; +import online_status from "@/lib/online_status"; +import { openReport } from "@/components/Report"; +import { alert } from "@/lib/swal_config"; let last_id = 0; diff --git a/src/components/ProfileCard/ProfileCard.tsx b/src/components/ProfileCard/ProfileCard.tsx index 7abbe23638..3ee21d90fd 100644 --- a/src/components/ProfileCard/ProfileCard.tsx +++ b/src/components/ProfileCard/ProfileCard.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { getUserRating, is_novice, is_provisional, humble_rating } from "rank_utils"; -import { Player } from "Player"; -import { PlayerIcon } from "PlayerIcon"; -import * as preferences from "preferences"; +import { getUserRating, is_novice, is_provisional, humble_rating } from "@/lib/rank_utils"; +import { Player } from "@/components/Player"; +import { PlayerIcon } from "@/components/PlayerIcon"; +import * as preferences from "@/lib/preferences"; interface ProfileCardInterface { user: any; diff --git a/src/components/RatingsChart/RatingEntry.ts b/src/components/RatingsChart/RatingEntry.ts index a936c3c6f0..0e9e2d9979 100644 --- a/src/components/RatingsChart/RatingEntry.ts +++ b/src/components/RatingsChart/RatingEntry.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { effective_outcome, EffectiveOutcome } from "rank_utils"; +import { effective_outcome, EffectiveOutcome } from "@/lib/rank_utils"; export interface IRatingEntry { ended: Date; diff --git a/src/components/RatingsChart/RatingsChart.tsx b/src/components/RatingsChart/RatingsChart.tsx index 0bacb96619..82a28fc92b 100644 --- a/src/components/RatingsChart/RatingsChart.tsx +++ b/src/components/RatingsChart/RatingsChart.tsx @@ -19,13 +19,13 @@ * is a d3.js v4 port of https://github.com/arnauddri/d3-stock */ import * as d3 from "d3"; -import * as moment from "moment"; +import moment from "moment"; import * as React from "react"; -import { OgsResizeDetector } from "OgsResizeDetector"; -import { _, pgettext, interpolate } from "translate"; -import { PersistentElement } from "PersistentElement"; +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { PersistentElement } from "@/components/PersistentElement"; import { RatingEntry, makeRatingEntry } from "./RatingEntry"; -import { errorLogger } from "misc"; +import { errorLogger } from "@/lib/misc"; import { rating_to_rank, @@ -33,7 +33,7 @@ import { is_rank_bounded, humble_rating, bounded_rank, -} from "rank_utils"; +} from "@/lib/rank_utils"; type speed_t = "overall" | "blitz" | "live" | "correspondence"; diff --git a/src/components/RatingsChartByGame/RatingEntry.ts b/src/components/RatingsChartByGame/RatingEntry.ts index 5f6f6d1e65..171024ce9b 100644 --- a/src/components/RatingsChartByGame/RatingEntry.ts +++ b/src/components/RatingsChartByGame/RatingEntry.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { effective_outcome, EffectiveOutcome } from "rank_utils"; +import { effective_outcome, EffectiveOutcome } from "@/lib/rank_utils"; export interface IRatingEntry { ended: Date; diff --git a/src/components/RatingsChartByGame/RatingsChartByGame.tsx b/src/components/RatingsChartByGame/RatingsChartByGame.tsx index 1509696b20..1eeb46a745 100644 --- a/src/components/RatingsChartByGame/RatingsChartByGame.tsx +++ b/src/components/RatingsChartByGame/RatingsChartByGame.tsx @@ -22,14 +22,14 @@ /* (Which is why it's structure is the same) */ import * as d3 from "d3"; -import * as moment from "moment"; +import moment from "moment"; import * as React from "react"; -import { OgsResizeDetector } from "OgsResizeDetector"; -import { _, pgettext, interpolate } from "translate"; -import { PersistentElement } from "PersistentElement"; +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { PersistentElement } from "@/components/PersistentElement"; import { RatingEntry, makeRatingEntry } from "./RatingEntry"; -import { errorLogger } from "misc"; -import { MiniGoban } from "MiniGoban"; +import { errorLogger } from "@/lib/misc"; +import { MiniGoban } from "@/components/MiniGoban"; import { rating_to_rank, @@ -37,7 +37,7 @@ import { is_rank_bounded, humble_rating, bounded_rank, -} from "rank_utils"; +} from "@/lib/rank_utils"; type speed_t = "overall" | "blitz" | "live" | "correspondence"; diff --git a/src/components/RengoManagementPane/RengoManagementPane.tsx b/src/components/RengoManagementPane/RengoManagementPane.tsx index a658554a3d..ead2bc56a9 100644 --- a/src/components/RengoManagementPane/RengoManagementPane.tsx +++ b/src/components/RengoManagementPane/RengoManagementPane.tsx @@ -17,9 +17,9 @@ import * as React from "react"; import * as DynamicHelp from "react-dynamic-help"; -import { Challenge } from "challenge_utils"; -import { useUser } from "hooks"; -import { _, pgettext, interpolate } from "translate"; +import { Challenge } from "@/lib/challenge_utils"; +import { useUser } from "@/lib/hooks"; +import { _, pgettext, interpolate } from "@/lib/translate"; interface RengoManagementPaneProperties { user: rest_api.UserConfig; diff --git a/src/components/RengoTeamManagementPane/RengoTeamManagementPane.tsx b/src/components/RengoTeamManagementPane/RengoTeamManagementPane.tsx index 2084496083..60c5b30e3f 100644 --- a/src/components/RengoTeamManagementPane/RengoTeamManagementPane.tsx +++ b/src/components/RengoTeamManagementPane/RengoTeamManagementPane.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import { rectSortingStrategy } from "@dnd-kit/sortable"; -import { MultipleContainers } from "Sortable/MultipleContainers/MultipleContainers"; +import { MultipleContainers } from "@/components/Sortable/MultipleContainers/MultipleContainers"; -import * as rengo_utils from "rengo_utils"; -import * as rengo_balancer from "rengo_balancer"; -import { _, pgettext } from "translate"; -import { errorAlerter } from "misc"; +import * as rengo_utils from "@/lib/rengo_utils"; +import * as rengo_balancer from "@/lib/rengo_balancer"; +import { _, pgettext } from "@/lib/translate"; +import { errorAlerter } from "@/lib/misc"; -import { Player } from "Player"; -import { EmbeddedChatCard } from "Chat"; +import { Player } from "@/components/Player"; +import { EmbeddedChatCard } from "@/components/Chat"; type Challenge = socket_api.seekgraph_global.Challenge; type RengoParticipantsDTO = rest_api.RengoParticipantsDTO; diff --git a/src/components/Report/Report.tsx b/src/components/Report/Report.tsx index 5c53d1d1c9..2cd891b857 100644 --- a/src/components/Report/Report.tsx +++ b/src/components/Report/Report.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import * as ReactDOM from "react-dom/client"; -import * as player_cache from "player_cache"; -import { Card } from "material"; -import { _, pgettext, interpolate } from "translate"; -import { PlayerIcon } from "PlayerIcon"; -import { post } from "requests"; -import { alert } from "swal_config"; -import { setIgnore } from "BlockPlayer"; -import { useUser } from "hooks"; -import { get } from "requests"; -import { toast } from "toast"; +import * as player_cache from "@/lib/player_cache"; +import { Card } from "@/components/material"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { PlayerIcon } from "@/components/PlayerIcon"; +import { post } from "@/lib/requests"; +import { alert } from "@/lib/swal_config"; +import { setIgnore } from "@/components/BlockPlayer"; +import { useUser } from "@/lib/hooks"; +import { get } from "@/lib/requests"; +import { toast } from "@/lib/toast"; export type ReportType = | "all" // not a type, just useful for the enumeration diff --git a/src/components/ReportedConversationModal/ReportedConversationModal.tsx b/src/components/ReportedConversationModal/ReportedConversationModal.tsx index 0701fe9770..aa223ce6d9 100644 --- a/src/components/ReportedConversationModal/ReportedConversationModal.tsx +++ b/src/components/ReportedConversationModal/ReportedConversationModal.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { Player } from "Player"; -import { _ } from "translate"; -import { Modal, openModal } from "Modal"; -import { ReportedConversation } from "Report"; +import { Player } from "@/components/Player"; +import { _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; +import { ReportedConversation } from "@/components/Report"; interface ReportedConversationModalProps { player_id: number; diff --git a/src/components/SGFPasteModal/SGFPasteModal.tsx b/src/components/SGFPasteModal/SGFPasteModal.tsx index 383bf3b286..ae6883ed91 100644 --- a/src/components/SGFPasteModal/SGFPasteModal.tsx +++ b/src/components/SGFPasteModal/SGFPasteModal.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { pgettext, _ } from "translate"; -import { Modal, openModal } from "Modal"; +import { pgettext, _ } from "@/lib/translate"; +import { Modal, openModal } from "@/components/Modal"; interface Events {} diff --git a/src/components/SeekGraph/SeekGraph.tsx b/src/components/SeekGraph/SeekGraph.tsx index e9cba5d014..622a291340 100644 --- a/src/components/SeekGraph/SeekGraph.tsx +++ b/src/components/SeekGraph/SeekGraph.tsx @@ -17,27 +17,31 @@ import * as React from "react"; import * as ReactDOM from "react-dom/client"; -import { browserHistory } from "ogsHistory"; -import { _, pgettext, interpolate } from "translate"; -import { del } from "requests"; -import { socket } from "sockets"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import * as data from "data"; -import { openGameAcceptModal } from "GameAcceptModal"; -import { shortDurationString, shortShortTimeControl, timeControlSystemText } from "TimeControl"; -import { getRelativeEventPosition, errorAlerter } from "misc"; -import { rankString, bounded_rank, MaxRank } from "rank_utils"; -import { kb_bind, kb_unbind, Binding } from "KBShortcut"; -import { Player } from "Player"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { del } from "@/lib/requests"; +import { socket } from "@/lib/sockets"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import * as data from "@/lib/data"; +import { openGameAcceptModal } from "@/components/GameAcceptModal"; +import { + shortDurationString, + shortShortTimeControl, + timeControlSystemText, +} from "@/components/TimeControl"; +import { getRelativeEventPosition, errorAlerter } from "@/lib/misc"; +import { rankString, bounded_rank, MaxRank } from "@/lib/rank_utils"; +import { kb_bind, kb_unbind, Binding } from "@/components/KBShortcut"; +import { Player } from "@/components/Player"; import { computeAverageMoveTime, validateCanvas } from "goban"; -import * as player_cache from "player_cache"; +import * as player_cache from "@/lib/player_cache"; -import { nominateForRengoChallenge } from "rengo_utils"; -import { alert } from "swal_config"; +import { nominateForRengoChallenge } from "@/lib/rengo_utils"; +import { alert } from "@/lib/swal_config"; import { SeekGraphColorPalette, SeekGraphPalettes } from "./SeekGraphPalettes"; import * as SeekGraphSymbols from "./SeekGraphSymbols"; -import { Challenge, ChallengeFilter, shouldDisplayChallenge } from "challenge_utils"; +import { Challenge, ChallengeFilter, shouldDisplayChallenge } from "@/lib/challenge_utils"; import { SeekgraphDeleteMessage, SeekgraphStartedMessage, SeekgraphChallengeMessage } from "goban"; interface ExtendedSeekgraphChallengeMessage extends SeekgraphChallengeMessage { diff --git a/src/components/SeekGraph/SeekGraphLegend.tsx b/src/components/SeekGraph/SeekGraphLegend.tsx index e92eea6b16..29ad4e264e 100644 --- a/src/components/SeekGraph/SeekGraphLegend.tsx +++ b/src/components/SeekGraph/SeekGraphLegend.tsx @@ -16,8 +16,8 @@ */ import React from "react"; -import { Card } from "material"; -import { _ } from "translate"; +import { Card } from "@/components/material"; +import { _ } from "@/lib/translate"; import { drawChallengeCircle, drawChallengeSquare, @@ -25,8 +25,8 @@ import { drawLegendKey, } from "./SeekGraphSymbols"; import { ChallengePointStyle, SeekGraphColorPalette, SeekGraphPalettes } from "./SeekGraphPalettes"; -import * as data from "data"; -import { ChallengeFilter, ChallengeFilterKey } from "challenge_utils"; +import * as data from "@/lib/data"; +import { ChallengeFilter, ChallengeFilterKey } from "@/lib/challenge_utils"; // import { SeekGraph } from "./SeekGraph"; // import { SeekGraphColorPalette } from "./SeekGraphPalettes"; diff --git a/src/components/ServerTimeDisplay/ServerTimeDisplay.tsx b/src/components/ServerTimeDisplay/ServerTimeDisplay.tsx index 02e48b2595..3f14e2c289 100644 --- a/src/components/ServerTimeDisplay/ServerTimeDisplay.tsx +++ b/src/components/ServerTimeDisplay/ServerTimeDisplay.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import * as moment from "moment"; -import { _, interpolate } from "translate"; +import moment from "moment"; +import { _, interpolate } from "@/lib/translate"; interface ServerTimeState { time: moment.Moment; diff --git a/src/components/SocialLoginButtons/SocialLoginButtons.tsx b/src/components/SocialLoginButtons/SocialLoginButtons.tsx index 41895c38fa..c19e175bc2 100644 --- a/src/components/SocialLoginButtons/SocialLoginButtons.tsx +++ b/src/components/SocialLoginButtons/SocialLoginButtons.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; type SocialLoginButtonsProps = { next_url?: string; diff --git a/src/components/SupporterProblems/SupporterProblems.tsx b/src/components/SupporterProblems/SupporterProblems.tsx index 27b1831801..e4adb8251a 100644 --- a/src/components/SupporterProblems/SupporterProblems.tsx +++ b/src/components/SupporterProblems/SupporterProblems.tsx @@ -16,12 +16,12 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { useUser } from "hooks"; +import { _ } from "@/lib/translate"; +import { useUser } from "@/lib/hooks"; import { useNotifications } from "../Notifications"; -import { notification_manager } from "Notifications/NotificationManager"; +import { notification_manager } from "@/components/Notifications/NotificationManager"; import { Link } from "react-router-dom"; -//import * as data from "data"; +//import * as data from "@/lib/data"; export function SupporterProblems(): JSX.Element | null { const user = useUser(); diff --git a/src/components/TimeControl/TimeControlPicker.tsx b/src/components/TimeControl/TimeControlPicker.tsx index 56c7eee1f0..0c39a8ec7e 100644 --- a/src/components/TimeControl/TimeControlPicker.tsx +++ b/src/components/TimeControl/TimeControlPicker.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { capitalize } from "misc"; -import { _ } from "translate"; +import { capitalize } from "@/lib/misc"; +import { _ } from "@/lib/translate"; import { TimeControl, TimeControlTypes } from "./TimeControl"; import { updateProperty, updateSpeed, updateSystem } from "./TimeControlUpdates"; diff --git a/src/components/TimeControl/TimeControlUpdates.ts b/src/components/TimeControl/TimeControlUpdates.ts index 9f5b37e490..fe41fadfdf 100644 --- a/src/components/TimeControl/TimeControlUpdates.ts +++ b/src/components/TimeControl/TimeControlUpdates.ts @@ -17,8 +17,8 @@ import { TimeControl, TimeControlTypes } from "./TimeControl"; import { classifyGameSpeed, getDefaultTimeControl, getInputRange, getTimeOptions } from "./util"; -import * as data from "data"; -import { interpolate, pgettext } from "translate"; +import * as data from "@/lib/data"; +import { interpolate, pgettext } from "@/lib/translate"; import { computeAverageMoveTime } from "goban"; type TimeControlSystem = TimeControlTypes.TimeControlSystem; diff --git a/src/components/TimeControl/util.ts b/src/components/TimeControl/util.ts index 799f2f7682..43356df6b4 100644 --- a/src/components/TimeControl/util.ts +++ b/src/components/TimeControl/util.ts @@ -16,7 +16,7 @@ */ import { computeAverageMoveTime, GobanRenderer, JGOFTimeControl } from "goban"; -import { _, pgettext, ngettext, interpolate } from "translate"; +import { _, pgettext, ngettext, interpolate } from "@/lib/translate"; import { TimeControl, TimeControlTypes } from "./TimeControl"; type TimeControlSystem = TimeControlTypes.TimeControlSystem; diff --git a/src/components/TurnIndicator/TurnIndicator.tsx b/src/components/TurnIndicator/TurnIndicator.tsx index 8b3c98d171..6b7335fd2c 100644 --- a/src/components/TurnIndicator/TurnIndicator.tsx +++ b/src/components/TurnIndicator/TurnIndicator.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { notification_manager } from "Notifications"; +import { notification_manager } from "@/components/Notifications"; export function TurnIndicator(): JSX.Element { const [count, setCount] = React.useState(0); diff --git a/src/components/TypedEventEmitterPureComponent/TypedEventEmitterPureComponent.tsx b/src/components/TypedEventEmitterPureComponent/TypedEventEmitterPureComponent.tsx index 5cbc15c8f6..7d323200c6 100644 --- a/src/components/TypedEventEmitterPureComponent/TypedEventEmitterPureComponent.tsx +++ b/src/components/TypedEventEmitterPureComponent/TypedEventEmitterPureComponent.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { TypedEventEmitter } from "TypedEventEmitter"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; export class TypedEventEmitterPureComponent extends React.PureComponent< Props, diff --git a/src/components/UIPush/UIPush.tsx b/src/components/UIPush/UIPush.tsx index aa1c714c54..11f1ec1f94 100644 --- a/src/components/UIPush/UIPush.tsx +++ b/src/components/UIPush/UIPush.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { socket } from "sockets"; +import { socket } from "@/lib/sockets"; interface UIPushProperties { event: string; diff --git a/src/lib/ITC.ts b/src/lib/ITC.ts index c2922ba7c0..791bfa7670 100644 --- a/src/lib/ITC.ts +++ b/src/lib/ITC.ts @@ -16,7 +16,7 @@ */ /* Inter tab communications library */ -import { socket } from "sockets"; +import { socket } from "@/lib/sockets"; const registrations: { [event: string]: Array<(data: any) => void> } = {}; diff --git a/src/lib/SettingsCommon.tsx b/src/lib/SettingsCommon.tsx index a59000b3d5..6ee53ea75a 100644 --- a/src/lib/SettingsCommon.tsx +++ b/src/lib/SettingsCommon.tsx @@ -18,10 +18,10 @@ import * as React from "react"; import Select from "react-select"; -import { usePreference } from "preferences"; -import { ValidPreference } from "preferences"; +import { usePreference } from "@/lib/preferences"; +import { ValidPreference } from "@/lib/preferences"; -import { Toggle } from "Toggle"; +import { Toggle } from "@/components/Toggle"; export const MAX_DOCK_DELAY = 3.0; export const MAX_AI_VAR_MOVES = 10; diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 6962efad65..00eef34018 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -15,12 +15,12 @@ * along with this program. If not, see . */ -import * as data from "data"; -import cached from "cached"; -import { get } from "requests"; -import { errorLogger } from "misc"; -import ITC from "ITC"; -import { alert } from "swal_config"; +import * as data from "@/lib/data"; +import cached from "@/lib/cached"; +import { get } from "@/lib/requests"; +import { errorLogger } from "@/lib/misc"; +import ITC from "@/lib/ITC"; +import { alert } from "@/lib/swal_config"; ITC.register("logout", (device_uuid: string) => { if (device_uuid !== data.get("device.uuid", "")) { diff --git a/src/lib/automatch_manager.tsx b/src/lib/automatch_manager.tsx index 535264e6a5..b4b76ea361 100644 --- a/src/lib/automatch_manager.tsx +++ b/src/lib/automatch_manager.tsx @@ -16,11 +16,11 @@ */ import * as React from "react"; -import { pgettext, interpolate } from "translate"; -import { socket } from "sockets"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import { browserHistory } from "ogsHistory"; -import { Toast, toast } from "toast"; +import { pgettext, interpolate } from "@/lib/translate"; +import { socket } from "@/lib/sockets"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { browserHistory } from "@/lib/ogsHistory"; +import { Toast, toast } from "@/lib/toast"; import { AutomatchPreferencesBase, Size, Speed } from "./types"; interface Events { diff --git a/src/lib/bots.ts b/src/lib/bots.ts index 75091c290b..b667ea4863 100644 --- a/src/lib/bots.ts +++ b/src/lib/bots.ts @@ -15,8 +15,8 @@ * along with this program. If not, see . */ -import { socket } from "sockets"; -import { getUserRating } from "rank_utils"; +import { socket } from "@/lib/sockets"; +import { getUserRating } from "@/lib/rank_utils"; import { User } from "goban"; let active_bots: { [id: number]: User } = {}; diff --git a/src/lib/cached.ts b/src/lib/cached.ts index 4b991d50b8..537b5987c3 100644 --- a/src/lib/cached.ts +++ b/src/lib/cached.ts @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -import { push_manager } from "UIPush"; -import * as data from "data"; -import { get } from "requests"; -import ITC from "ITC"; -import * as player_cache from "player_cache"; +import { push_manager } from "@/components/UIPush"; +import * as data from "@/lib/data"; +import { get } from "@/lib/requests"; +import ITC from "@/lib/ITC"; +import * as player_cache from "@/lib/player_cache"; /** * This is a set of keys to be used for data.get(..) and data.watch(..) calls. diff --git a/src/lib/chat_manager.ts b/src/lib/chat_manager.ts index 072f83c9a7..0b7ee9c2f7 100644 --- a/src/lib/chat_manager.ts +++ b/src/lib/chat_manager.ts @@ -17,19 +17,19 @@ /* spell-checker: disable */ -import cached from "cached"; -import * as data from "data"; -import * as preferences from "preferences"; -import * as player_cache from "player_cache"; -import { socket } from "sockets"; -import { get } from "requests"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import { emitNotification } from "Notifications"; -import { bounded_rank } from "rank_utils"; -import { ActiveTournamentList, GroupList } from "types"; -import { _, interpolate } from "translate"; -import { getBlocks } from "BlockPlayer"; -import { insert_into_sorted_list, string_splitter, n2s, Timeout } from "misc"; +import cached from "@/lib/cached"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import * as player_cache from "@/lib/player_cache"; +import { socket } from "@/lib/sockets"; +import { get } from "@/lib/requests"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { emitNotification } from "@/components/Notifications"; +import { bounded_rank } from "@/lib/rank_utils"; +import { ActiveTournamentList, GroupList } from "@/lib/types"; +import { _, interpolate } from "@/lib/translate"; +import { getBlocks } from "@/components/BlockPlayer"; +import { insert_into_sorted_list, string_splitter, n2s, Timeout } from "@/lib/misc"; import { User } from "goban"; export interface ChatMessage { diff --git a/src/lib/configure-goban.tsx b/src/lib/configure-goban.tsx index b2a7a98d44..81090a29e3 100644 --- a/src/lib/configure-goban.tsx +++ b/src/lib/configure-goban.tsx @@ -15,16 +15,16 @@ * along with this program. If not, see . */ -import * as preferences from "preferences"; -import * as data from "data"; +import * as preferences from "@/lib/preferences"; +import * as data from "@/lib/data"; import * as Sentry from "@sentry/browser"; import * as React from "react"; -import { _ } from "translate"; -import { get_clock_drift, get_network_latency, socket } from "sockets"; -import { current_language } from "translate"; +import { _ } from "@/lib/translate"; +import { get_clock_drift, get_network_latency, socket } from "@/lib/sockets"; +import { current_language } from "@/lib/translate"; import { Goban, GobanBase, GobanEngine, setGobanRenderer } from "goban"; -import { sfx } from "sfx"; -import { toast } from "toast"; +import { sfx } from "@/lib/sfx"; +import { toast } from "@/lib/toast"; (window as any)["GobanThemes"] = Goban.THEMES; (window as any)["GobanEngine"] = GobanEngine; diff --git a/src/lib/data.ts b/src/lib/data.ts index cd2978f105..5c6cd00682 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -97,8 +97,8 @@ * */ -import { TypedEventEmitter } from "TypedEventEmitter"; -import { DataSchema } from "data_schema"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { DataSchema } from "@/lib/data_schema"; import { protocol } from "goban"; interface DataEvents { @@ -378,8 +378,8 @@ try { * only updated data will be downloaded. */ -import ITC from "ITC"; -import { socket } from "sockets"; +import ITC from "@/lib/ITC"; +import { socket } from "@/lib/sockets"; type RemoteStorableValue = | number diff --git a/src/lib/data_schema.ts b/src/lib/data_schema.ts index 93c9584400..0c21fc8ed8 100644 --- a/src/lib/data_schema.ts +++ b/src/lib/data_schema.ts @@ -21,15 +21,15 @@ */ import { GroupList, ActiveTournamentList, Size, RuleSet } from "./types"; -import { Announcement } from "src/components/Announcements"; +import { Announcement } from "@/components/Announcements"; import { ValidSound, ValidSoundGroup } from "./sfx"; import { defaults as defaultPreferences, ValidPreference } from "./preferences"; -import { TimeControl, TimeControlTypes } from "src/components/TimeControl"; +import { TimeControl, TimeControlTypes } from "@/components/TimeControl"; import TimeControlSpeed = TimeControlTypes.TimeControlSpeed; import TimeControlSystem = TimeControlTypes.TimeControlSystem; -import { AutomatchPreferences } from "src/components/AutomatchSettings"; -import { JosekiFilter } from "src/components/JosekiVariationFilter"; -import { Challenge } from "challenge_utils"; +import { AutomatchPreferences } from "@/components/AutomatchSettings"; +import { JosekiFilter } from "@/components/JosekiVariationFilter"; +import { Challenge } from "@/lib/challenge_utils"; interface CachedSchema { groups: GroupList; diff --git a/src/lib/hooks.ts b/src/lib/hooks.ts index 5eef6fb424..594cf9e350 100644 --- a/src/lib/hooks.ts +++ b/src/lib/hooks.ts @@ -16,7 +16,7 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { DataSchema } from "./data_schema"; import { Goban } from "goban"; diff --git a/src/lib/localize-time.ts b/src/lib/localize-time.ts index af533388cf..4791fcc930 100644 --- a/src/lib/localize-time.ts +++ b/src/lib/localize-time.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import * as moment from "moment-timezone"; +import moment from "moment-timezone"; export function localize_time_strings(str: string): string { try { diff --git a/src/lib/misc.ts b/src/lib/misc.ts index 39777130c5..7dbcbeb54c 100644 --- a/src/lib/misc.ts +++ b/src/lib/misc.ts @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -import { _, interpolate, pgettext } from "translate"; -import { errcodeAlerter } from "ErrcodeModal"; -import { browserHistory } from "ogsHistory"; -import * as preferences from "preferences"; -import { alert } from "swal_config"; +import { _, interpolate, pgettext } from "@/lib/translate"; +import { errcodeAlerter } from "@/components/ErrcodeModal"; +import { browserHistory } from "@/lib/ogsHistory"; +import * as preferences from "@/lib/preferences"; +import { alert } from "@/lib/swal_config"; import React from "react"; import moment from "moment"; diff --git a/src/lib/moderation.tsx b/src/lib/moderation.tsx index 944d798ea6..26b93f0ece 100644 --- a/src/lib/moderation.tsx +++ b/src/lib/moderation.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { post } from "requests"; -import { alert } from "swal_config"; +import { _ } from "@/lib/translate"; +import { post } from "@/lib/requests"; +import { alert } from "@/lib/swal_config"; import { GobanEngineConfig } from "goban"; -import { errorAlerter } from "misc"; -import { toast } from "toast"; +import { errorAlerter } from "@/lib/misc"; +import { toast } from "@/lib/toast"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; // Must match back-end MODERATOR_POWER definition export enum MODERATOR_POWERS { diff --git a/src/ogsHistory.ts b/src/lib/ogsHistory.ts similarity index 100% rename from src/ogsHistory.ts rename to src/lib/ogsHistory.ts diff --git a/src/lib/online_status.ts b/src/lib/online_status.ts index ceea025db9..4352a3c212 100644 --- a/src/lib/online_status.ts +++ b/src/lib/online_status.ts @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -import { socket } from "sockets"; -import { TypedEventEmitter } from "TypedEventEmitter"; -import { Batcher } from "batcher"; +import { socket } from "@/lib/sockets"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; +import { Batcher } from "@/lib/batcher"; interface Events { "users-online-updated": never; diff --git a/src/lib/player_cache.ts b/src/lib/player_cache.ts index fb18758797..93a761371b 100644 --- a/src/lib/player_cache.ts +++ b/src/lib/player_cache.ts @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -import { get } from "requests"; -import { Batcher } from "batcher"; -import { Publisher, Subscriber as RealSubscriber } from "pubsub"; +import { get } from "@/lib/requests"; +import { Batcher } from "@/lib/batcher"; +import { Publisher, Subscriber as RealSubscriber } from "@/lib/pubsub"; -import Debug from "debug"; +import Debug from "@/lib/debug"; const debug = new Debug("player_cache"); // The player cache's Subscriber is just like a vanilla Subscriber, but can diff --git a/src/lib/popover.tsx b/src/lib/popover.tsx index d2b007f385..3c77fff218 100644 --- a/src/lib/popover.tsx +++ b/src/lib/popover.tsx @@ -17,7 +17,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom/client"; -import { TypedEventEmitter } from "TypedEventEmitter"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; interface Events { close: never; diff --git a/src/lib/preferences.ts b/src/lib/preferences.ts index bc8080a4cc..048e1c997e 100644 --- a/src/lib/preferences.ts +++ b/src/lib/preferences.ts @@ -15,12 +15,12 @@ * along with this program. If not, see . */ -import * as data from "data"; +import * as data from "@/lib/data"; import { GobanSelectedThemes, Goban, LabelPosition } from "goban"; import * as React from "react"; -import { current_language } from "translate"; +import { current_language } from "@/lib/translate"; import { DataSchema } from "./data_schema"; -import { FollowedChannel } from "GoTV"; +import { FollowedChannel } from "@/views/GoTV"; import { getWindowWidth } from "./device"; export const defaults = { diff --git a/src/lib/profanity_filter.ts b/src/lib/profanity_filter.ts index 51cd25a20c..f90d19bcfe 100644 --- a/src/lib/profanity_filter.ts +++ b/src/lib/profanity_filter.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; let filters: { [key: string]: boolean } = {}; export const profanity_regex: { [key: string]: RegExp } = {}; diff --git a/src/lib/rank_utils.ts b/src/lib/rank_utils.ts index b5fe3f791a..446f8f4823 100644 --- a/src/lib/rank_utils.ts +++ b/src/lib/rank_utils.ts @@ -16,7 +16,7 @@ */ import { User } from "goban"; -import { _, interpolate, pgettext } from "translate"; +import { _, interpolate, pgettext } from "@/lib/translate"; export interface IRankInfo { rank: number; diff --git a/src/lib/rengo_balancer.ts b/src/lib/rengo_balancer.ts index effc3f76a7..4367ad36f1 100644 --- a/src/lib/rengo_balancer.ts +++ b/src/lib/rengo_balancer.ts @@ -15,8 +15,8 @@ * along with this program. If not, see . */ -import * as player_cache from "player_cache"; -import { put } from "requests"; +import * as player_cache from "@/lib/player_cache"; +import { put } from "@/lib/requests"; type Participant = { user_id: number; diff --git a/src/lib/rengo_utils.ts b/src/lib/rengo_utils.ts index 1b9966f995..c606bfb8b4 100644 --- a/src/lib/rengo_utils.ts +++ b/src/lib/rengo_utils.ts @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -import { alert } from "swal_config"; -import { put, post, del } from "requests"; -import { _ } from "translate"; +import { alert } from "@/lib/swal_config"; +import { put, post, del } from "@/lib/requests"; +import { _ } from "@/lib/translate"; type Challenge = socket_api.seekgraph_global.Challenge; type RengoParticipantsDTO = rest_api.RengoParticipantsDTO; diff --git a/src/lib/report_manager.tsx b/src/lib/report_manager.tsx index 36d58fd426..888aab226b 100644 --- a/src/lib/report_manager.tsx +++ b/src/lib/report_manager.tsx @@ -21,17 +21,17 @@ */ import * as React from "react"; -import * as data from "data"; -import * as preferences from "preferences"; -import { toast } from "toast"; -import { alert } from "swal_config"; -import { socket } from "sockets"; -import { pgettext } from "translate"; -import { Report, community_mod_can_handle } from "report_util"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { toast } from "@/lib/toast"; +import { alert } from "@/lib/swal_config"; +import { socket } from "@/lib/sockets"; +import { pgettext } from "@/lib/translate"; +import { Report, community_mod_can_handle } from "@/lib/report_util"; import { EventEmitter } from "eventemitter3"; -import { emitNotification } from "Notifications"; -import { browserHistory } from "ogsHistory"; -import { get, post } from "requests"; +import { emitNotification } from "@/components/Notifications"; +import { browserHistory } from "@/lib/ogsHistory"; +import { get, post } from "@/lib/requests"; export interface ReportRelation { relationship: string; diff --git a/src/lib/report_util.ts b/src/lib/report_util.ts index 52623a487f..b88b5d6f93 100644 --- a/src/lib/report_util.ts +++ b/src/lib/report_util.ts @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -import { ReportedConversation } from "Report"; -import { PlayerCacheEntry } from "player_cache"; -import { MODERATOR_POWERS } from "moderation"; -import { ReportType } from "Report"; +import { ReportedConversation } from "@/components/Report"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import { MODERATOR_POWERS } from "@/lib/moderation"; +import { ReportType } from "@/components/Report"; interface Vote { voter_id: number; diff --git a/src/lib/requests.ts b/src/lib/requests.ts index e9dca5e572..e4fa6fbc74 100644 --- a/src/lib/requests.ts +++ b/src/lib/requests.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { deepCompare } from "misc"; +import { deepCompare } from "@/lib/misc"; /** * If a non-absolute path is provided, appends "/api/v1/" to the input. diff --git a/src/lib/sockets.ts b/src/lib/sockets.ts index e3e4eda3b3..b4d03bb0d4 100644 --- a/src/lib/sockets.ts +++ b/src/lib/sockets.ts @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -import Debug from "debug"; +import Debug from "@/lib/debug"; import { GobanSocket, protocol, GobanRenderer, JGOFTimeControl } from "goban"; -import { lookingAtOurLiveGame } from "TimeControl/util"; +import { lookingAtOurLiveGame } from "@/components/TimeControl/util"; const debug = new Debug("sockets"); @@ -33,7 +33,9 @@ const MIN_TIMEOUT_DELAY = 1000; const MAX_PING_INTERVAL = 15000; const MAX_TIMEOUT_DELAY = 14000; -export let ai_host = "http://localhost:13284"; +// TODO: localhost option removed for ai_host. Refactor. + +export let ai_host = "https://beta-ai.online-go.com"; if ( window.location.hostname.indexOf("dev.beta") >= 0 && (window as any)["websocket_host"] === "https://online-go.com" @@ -43,7 +45,7 @@ if ( console.log("AI Host set to: ", ai_host); } else if (typeof process !== "undefined" && process.env.OGS_BACKEND === "LOCAL") { // if we're a developer using a local server, then use it for ai - ai_host = "http://localhost:13284"; + ai_host = `http://localhost:13284`; } else if ( // The CI doesn't work with beta. Note that jest in the CI has NODE_ENV==="test". // the .org exception is for anoek's development environment diff --git a/src/lib/swal_config.ts b/src/lib/swal_config.ts index 93d6a97556..60c061f3b6 100644 --- a/src/lib/swal_config.ts +++ b/src/lib/swal_config.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { _ } from "translate"; +import { _ } from "@/lib/translate"; import Swal from "sweetalert2"; /*** SweetAlert setup ***/ diff --git a/src/lib/tab_complete.ts b/src/lib/tab_complete.ts index 27e6471dff..2436db6adb 100644 --- a/src/lib/tab_complete.ts +++ b/src/lib/tab_complete.ts @@ -18,7 +18,7 @@ * Dual licenses under MIT or GPL */ -import * as player_cache from "player_cache"; +import * as player_cache from "@/lib/player_cache"; declare let $: any; diff --git a/src/lib/toast.tsx b/src/lib/toast.tsx index 2a0d7cb2ca..9a274dd88a 100644 --- a/src/lib/toast.tsx +++ b/src/lib/toast.tsx @@ -17,7 +17,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom/client"; -import { TypedEventEmitter } from "TypedEventEmitter"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; interface Events { close: never; diff --git a/src/lib/translate.ts b/src/lib/translate.ts index 7710f28318..5961385bad 100644 --- a/src/lib/translate.ts +++ b/src/lib/translate.ts @@ -213,20 +213,6 @@ export function pgettext(context: string, msgid: string) { return debug_wrap(msgid); } -/** - * Like pgettext(), but these strings will be automatically translated instead of passed along to our volunteers. - * - * The context is fed into the LLM system as general instructions and context. - * The msgid is the message that needs to be translated. - */ -export function llm_pgettext(context: string, msgid: string) { - const key = context + "" + msgid; - if (key in catalog) { - return catalog[key][0]; - } - return debug_wrap(msgid); -} - /** * Like pgettext() but for plural forms. */ diff --git a/src/lib/types.ts b/src/lib/types.ts index 1961253916..16d0b81d81 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { PlayerCacheEntry } from "player_cache"; +import { PlayerCacheEntry } from "@/lib/player_cache"; import { GobanEngineRules, JGOFTimeControl } from "goban"; export interface Player extends PlayerCacheEntry { diff --git a/src/main.tsx b/src/main.tsx index 6ea92d6d7e..b3e7987032 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -16,10 +16,7 @@ */ import * as Sentry from "@sentry/browser"; -import { apply_polyfills } from "polyfills"; -apply_polyfills(); - -import { configure_goban } from "configure-goban"; +import { configure_goban } from "@/lib/configure-goban"; import { init_wasm_ownership_estimator, init_remote_ownership_estimator, @@ -27,11 +24,11 @@ import { ScoreEstimateResponse, } from "goban"; -import { OgsHelpProvider } from "OgsHelpProvider"; -import { HelpFlows } from "HelpFlows"; -import { sfx } from "sfx"; -import { post } from "requests"; -import { ai_host } from "sockets"; +import { OgsHelpProvider } from "@/components/OgsHelpProvider"; +import { HelpFlows } from "@/views/HelpFlows"; +import { sfx } from "@/lib/sfx"; +import { post } from "@/lib/requests"; +import { ai_host } from "@/lib/sockets"; sfx.sync(); declare let ogs_current_language: string; @@ -118,9 +115,9 @@ try { console.log(e); } -import * as data from "data"; +import * as data from "@/lib/data"; -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; try { // default_theme is set in index.html based on looking at the OS theme @@ -163,22 +160,22 @@ configure_goban(); import * as React from "react"; import * as ReactDOM from "react-dom/client"; -import { browserHistory } from "./ogsHistory"; +import { browserHistory } from "@/lib/ogsHistory"; import { routes } from "./routes"; //import {Promise} from "es6-promise"; -import { errorAlerter } from "misc"; -import { close_all_popovers } from "popover"; -import * as sockets from "sockets"; -import { _, setCurrentLanguage } from "translate"; -import { init_tab_complete } from "tab_complete"; -import * as player_cache from "player_cache"; -import { toast } from "toast"; -import cached from "cached"; -import * as moment from "moment"; -import { get_device_id } from "SignIn"; - -import { ConfigSchema } from "data_schema"; +import { errorAlerter } from "@/lib/misc"; +import { close_all_popovers } from "@/lib/popover"; +import * as sockets from "@/lib/sockets"; +import { _, setCurrentLanguage } from "@/lib/translate"; +import { init_tab_complete } from "@/lib/tab_complete"; +import * as player_cache from "@/lib/player_cache"; +import { toast } from "@/lib/toast"; +import cached from "@/lib/cached"; +import moment from "moment"; +import { get_device_id } from "@/views/SignIn"; + +import { ConfigSchema } from "@/lib/data_schema"; import * as history from "history"; import "debug"; @@ -344,5 +341,5 @@ react_root.render( (window as any)["preferences"] = preferences; (window as any)["player_cache"] = player_cache; -import * as requests from "requests"; +import * as requests from "@/lib/requests"; (window as any)["requests"] = requests; diff --git a/src/ogs.styl b/src/ogs.styl index cded00f843..fa16b6b4ac 100644 --- a/src/ogs.styl +++ b/src/ogs.styl @@ -590,4 +590,4 @@ nowrap() .react-tabs__tab-panel--selected { display: block; padding: 10px; -} \ No newline at end of file +} diff --git a/src/routes.tsx b/src/routes.tsx index febf0cc2eb..f6ac0d1100 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -26,62 +26,62 @@ import { useNavigate, } from "react-router-dom"; -import * as data from "data"; -import { _ } from "translate"; -import { browserHistory } from "./ogsHistory"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; +import { browserHistory } from "@/lib/ogsHistory"; -import { ErrorBoundary } from "ErrorBoundary"; -import { NavBar } from "NavBar"; -import { Announcements } from "Announcements"; -import { SignIn } from "SignIn"; -import { Register } from "Register"; -import { ChallengeLinkLanding } from "ChallengeLinkLanding"; -import { Overview } from "Overview"; -import { Admin, MerchantLog, FlaggedGames, OnlineLeaguesAdmin } from "Admin"; -import { ChatView } from "ChatView"; -import { Developer } from "Developer"; -import { Game } from "Game"; -import { GameEmbed } from "GameEmbed"; -import { Joseki } from "Joseki"; -import { Group } from "Group"; -import { GroupCreate } from "GroupCreate"; -import { GroupList } from "GroupList"; -import { Ladder } from "Ladder"; -import { LadderList } from "LadderList"; -import { LibraryPlayer } from "LibraryPlayer"; -import { Play } from "Play"; -import { Moderator } from "Moderator"; -import { ObserveGames } from "ObserveGames"; -import { Puzzle } from "Puzzle"; -import { PuzzleList } from "PuzzleList"; -import { PuzzleCollectionList, PuzzleCollection } from "PuzzleCollection"; -import { Supporter } from "Supporter"; -import { Tournament } from "Tournament"; -import { TournamentRecord } from "TournamentRecord"; -import { TournamentListMainView } from "TournamentList"; -import { LearningHub } from "LearningHub"; -import { User, UserByName } from "User"; -import { Settings } from "Settings"; -import { Styling } from "Styling"; -import { OnlineLeaguePlayerLanding } from "OnlineLeaguePlayerLanding"; -import { OnlineLeagueSpectatorLanding } from "OnlineLeagueSpectatorLanding"; -import { AnnouncementCenter } from "AnnouncementCenter"; -import { VerifyEmail } from "VerifyEmail"; -import { global_channels } from "chat_manager"; -import { ForceUsernameChange } from "ForceUsernameChange"; -import { BlockedVPN } from "BlockedVPN"; -import { Firewall } from "Firewall"; -import { Appeal } from "Appeal"; -import { AppealsCenter } from "AppealsCenter"; -import { ReportsCenter } from "ReportsCenter"; -import { Experiment, Variant, Default as ExDefault } from "Experiment"; -import { RatingCalculator } from "RatingCalculator"; -import { AccountWarning } from "AccountWarning"; -import { NetworkStatus } from "NetworkStatus"; -import { PrizeBatchList, PrizeBatch, PrizeRedemption } from "Prizes"; -import { GoTV } from "GoTV"; +import { ErrorBoundary } from "@/components/ErrorBoundary"; +import { NavBar } from "@/components/NavBar"; +import { Announcements } from "@/components/Announcements"; +import { SignIn } from "@/views/SignIn"; +import { Register } from "@/views/Register"; +import { ChallengeLinkLanding } from "@/views/ChallengeLinkLanding"; +import { Overview } from "@/views/Overview"; +import { Admin, MerchantLog, FlaggedGames, OnlineLeaguesAdmin } from "@/views/Admin"; +import { ChatView } from "@/views/ChatView"; +import { Developer } from "@/views/Developer"; +import { Game } from "@/views/Game"; +import { GameEmbed } from "@/views/GameEmbed"; +import { Joseki } from "@/views/Joseki"; +import { Group } from "@/views/Group"; +import { GroupCreate } from "@/views/GroupCreate"; +import { GroupList } from "@/views/GroupList"; +import { Ladder } from "@/views/Ladder"; +import { LadderList } from "@/views/LadderList"; +import { LibraryPlayer } from "@/views/LibraryPlayer"; +import { Play } from "@/views/Play"; +import { Moderator } from "@/views/Moderator"; +import { ObserveGames } from "@/views/ObserveGames"; +import { Puzzle } from "@/views/Puzzle"; +import { PuzzleList } from "@/views/PuzzleList"; +import { PuzzleCollectionList, PuzzleCollection } from "@/views/PuzzleCollection"; +import { Supporter } from "@/views/Supporter"; +import { Tournament } from "@/views/Tournament"; +import { TournamentRecord } from "@/views/TournamentRecord"; +import { TournamentListMainView } from "@/views/TournamentList"; +import { LearningHub } from "@/views/LearningHub"; +import { User, UserByName } from "@/views/User"; +import { Settings } from "@/views/Settings"; +import { Styling } from "@/views/Styling"; +import { OnlineLeaguePlayerLanding } from "@/views/OnlineLeaguePlayerLanding"; +import { OnlineLeagueSpectatorLanding } from "@/views/OnlineLeagueSpectatorLanding"; +import { AnnouncementCenter } from "@/views/AnnouncementCenter"; +import { VerifyEmail } from "@/views/VerifyEmail"; +import { global_channels } from "@/lib/chat_manager"; +import { ForceUsernameChange } from "@/views/ForceUsernameChange"; +import { BlockedVPN } from "@/views/BlockedVPN"; +import { Firewall } from "@/views/Firewall"; +import { Appeal } from "@/views/Appeal"; +import { AppealsCenter } from "@/views/AppealsCenter"; +import { ReportsCenter } from "@/views/ReportsCenter"; +import { Experiment, Variant, Default as ExDefault } from "@/components/Experiment"; +import { RatingCalculator } from "@/views/RatingCalculator"; +import { AccountWarning } from "@/components/AccountWarning"; +import { NetworkStatus } from "@/components/NetworkStatus"; +import { PrizeBatchList, PrizeBatch, PrizeRedemption } from "@/views/Prizes"; +import { GoTV } from "@/views/GoTV"; -import * as docs from "docs"; +import * as docs from "@/views/docs"; import { useData } from "./lib/hooks"; /*** Layout our main view and routes ***/ diff --git a/src/templates/component/TemplateComponent/TemplateComponent.tsx b/src/templates/component/TemplateComponent/TemplateComponent.tsx index 62837c7277..ee60760584 100644 --- a/src/templates/component/TemplateComponent/TemplateComponent.tsx +++ b/src/templates/component/TemplateComponent/TemplateComponent.tsx @@ -17,9 +17,9 @@ import * as React from "react"; -import { useUser } from "hooks"; +import { useUser } from "@/lib/hooks"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; type TemplateComponentProps = { render_twice?: boolean; diff --git a/src/views/Admin/Admin.tsx b/src/views/Admin/Admin.tsx index d01a4f2adf..de3ecf2dc0 100644 --- a/src/views/Admin/Admin.tsx +++ b/src/views/Admin/Admin.tsx @@ -17,9 +17,9 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { post } from "requests"; -import { getPrintableError } from "misc"; -import { alert } from "swal_config"; +import { post } from "@/lib/requests"; +import { getPrintableError } from "@/lib/misc"; +import { alert } from "@/lib/swal_config"; interface AdminState { results: any[]; diff --git a/src/views/Admin/FlaggedGames.tsx b/src/views/Admin/FlaggedGames.tsx index 200167488b..43d7f5eb65 100644 --- a/src/views/Admin/FlaggedGames.tsx +++ b/src/views/Admin/FlaggedGames.tsx @@ -17,9 +17,9 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { get } from "requests"; -import { Player } from "Player"; -//import * as moment from "moment"; +import { get } from "@/lib/requests"; +import { Player } from "@/components/Player"; +//import moment from "moment"; export function FlaggedGames(): JSX.Element { const [flagged_games, setFlaggedGames] = React.useState([]); diff --git a/src/views/Admin/MerchantLog.tsx b/src/views/Admin/MerchantLog.tsx index ce924381c3..58ba5355e4 100644 --- a/src/views/Admin/MerchantLog.tsx +++ b/src/views/Admin/MerchantLog.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { PaginatedTable } from "PaginatedTable"; -import * as moment from "moment"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import moment from "moment"; export class MerchantLog extends React.PureComponent<{}, any> { constructor(props: {}) { diff --git a/src/views/Admin/OnlineLeaguesAdmin.tsx b/src/views/Admin/OnlineLeaguesAdmin.tsx index c994fc0884..2094ff53a2 100644 --- a/src/views/Admin/OnlineLeaguesAdmin.tsx +++ b/src/views/Admin/OnlineLeaguesAdmin.tsx @@ -18,8 +18,8 @@ // A super-utilitarian page to see what COOL leagues there are, their auth_key, and add more. import * as React from "react"; -import { get, post, del } from "requests"; -import { useUser } from "hooks"; +import { get, post, del } from "@/lib/requests"; +import { useUser } from "@/lib/hooks"; export function OnlineLeaguesAdmin(): JSX.Element { const [leagues, set_leagues] = React.useState([]); diff --git a/src/views/AnnouncementCenter/AnnouncementCenter.tsx b/src/views/AnnouncementCenter/AnnouncementCenter.tsx index 37728c8719..a306732bfb 100644 --- a/src/views/AnnouncementCenter/AnnouncementCenter.tsx +++ b/src/views/AnnouncementCenter/AnnouncementCenter.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, interpolate, pgettext } from "translate"; -import { post, get, del } from "requests"; -import { PaginatedTable } from "PaginatedTable"; -import { Card } from "material"; -import { UIPush } from "UIPush"; -import { errorAlerter } from "misc"; -import { Player } from "Player"; -import * as moment from "moment"; -//import { Announcement } from "src/components/Announcements"; -import { useUser } from "hooks"; -import { Announcement } from "src/components/Announcements"; +import * as data from "@/lib/data"; +import { _, interpolate, pgettext } from "@/lib/translate"; +import { post, get, del } from "@/lib/requests"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import { Card } from "@/components/material"; +import { UIPush } from "@/components/UIPush"; +import { errorAlerter } from "@/lib/misc"; +import { Player } from "@/components/Player"; +import moment from "moment"; +//import { Announcement } from "@/components/Announcements"; +import { useUser } from "@/lib/hooks"; +import { Announcement } from "@/components/Announcements"; moment.relativeTimeThreshold("m", 59); diff --git a/src/views/Appeal/Appeal.tsx b/src/views/Appeal/Appeal.tsx index dc08c22f7e..2b56871a18 100644 --- a/src/views/Appeal/Appeal.tsx +++ b/src/views/Appeal/Appeal.tsx @@ -16,16 +16,16 @@ */ import * as React from "react"; -import * as data from "data"; -import * as moment from "moment"; -import { Card } from "material"; -import { post, get, patch } from "requests"; -import { _, pgettext, interpolate } from "translate"; -import { errorAlerter } from "misc"; +import * as data from "@/lib/data"; +import moment from "moment"; +import { Card } from "@/components/material"; +import { post, get, patch } from "@/lib/requests"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { errorAlerter } from "@/lib/misc"; import { useParams } from "react-router"; -import { Player } from "Player"; -import { AutoTranslate } from "AutoTranslate"; -import { UIPush } from "UIPush"; +import { Player } from "@/components/Player"; +import { AutoTranslate } from "@/components/AutoTranslate"; +import { UIPush } from "@/components/UIPush"; interface AppealMessage { id: number; diff --git a/src/views/AppealsCenter/AppealsCenter.tsx b/src/views/AppealsCenter/AppealsCenter.tsx index 5ba146c43a..356ff2f99d 100644 --- a/src/views/AppealsCenter/AppealsCenter.tsx +++ b/src/views/AppealsCenter/AppealsCenter.tsx @@ -17,12 +17,12 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { Player } from "Player"; -import { _ } from "translate"; -import * as moment from "moment"; -import { PaginatedTable } from "PaginatedTable"; -import * as data from "data"; -//import { alert } from "swal_config"; +import { Player } from "@/components/Player"; +import { _ } from "@/lib/translate"; +import moment from "moment"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import * as data from "@/lib/data"; +//import { alert } from "@/lib/swal_config"; export function AppealsCenter(): JSX.Element | null { const user = data.get("user"); diff --git a/src/views/BlockedVPN/BlockedVPN.tsx b/src/views/BlockedVPN/BlockedVPN.tsx index b499dd0066..c7eadfee28 100644 --- a/src/views/BlockedVPN/BlockedVPN.tsx +++ b/src/views/BlockedVPN/BlockedVPN.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import { alert } from "swal_config"; -import { post } from "requests"; -import { errorAlerter } from "misc"; +import { alert } from "@/lib/swal_config"; +import { post } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; export function BlockedVPN(): JSX.Element { const [vpn, setVPN] = React.useState(""); diff --git a/src/views/ChallengeLinkLanding/ChallengeLinkLanding.tsx b/src/views/ChallengeLinkLanding/ChallengeLinkLanding.tsx index 6bd5927540..3ebbff91f3 100644 --- a/src/views/ChallengeLinkLanding/ChallengeLinkLanding.tsx +++ b/src/views/ChallengeLinkLanding/ChallengeLinkLanding.tsx @@ -17,21 +17,21 @@ import * as React from "react"; import { useNavigate } from "react-router-dom"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; -import * as data from "data"; -import { useUser } from "hooks"; -import { _, pgettext, interpolate } from "translate"; -import { get, put, post } from "requests"; -import { errorAlerter } from "misc"; -import { browserHistory } from "ogsHistory"; -import { get_ebi } from "SignIn"; -import cached from "cached"; +import * as data from "@/lib/data"; +import { useUser } from "@/lib/hooks"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { get, put, post } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { browserHistory } from "@/lib/ogsHistory"; +import { get_ebi } from "@/views/SignIn"; +import cached from "@/lib/cached"; -import { Card } from "material"; -import { LoadingPage } from "Loading"; -import { Player } from "Player"; -import { ChallengeDetailsReviewPane } from "ChallengeDetailsReviewPane"; +import { Card } from "@/components/material"; +import { LoadingPage } from "@/components/Loading"; +import { Player } from "@/components/Player"; +import { ChallengeDetailsReviewPane } from "@/components/ChallengeDetailsReviewPane"; type Challenge = socket_api.seekgraph_global.Challenge; diff --git a/src/views/ChatView/ChatView.tsx b/src/views/ChatView/ChatView.tsx index 3df09f38d2..4591ef9998 100644 --- a/src/views/ChatView/ChatView.tsx +++ b/src/views/ChatView/ChatView.tsx @@ -16,9 +16,9 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { useState, useEffect, useCallback } from "react"; -import { ChatChannelList, ChatLog, ChatUsersList } from "Chat"; +import { ChatChannelList, ChatLog, ChatUsersList } from "@/components/Chat"; import { useParams } from "react-router"; export function ChatView(): JSX.Element | null { diff --git a/src/views/Developer/Developer.tsx b/src/views/Developer/Developer.tsx index c9fa209c7b..87e071375c 100644 --- a/src/views/Developer/Developer.tsx +++ b/src/views/Developer/Developer.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import * as data from "data"; -import { _ } from "translate"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; export class Developer extends React.PureComponent { constructor(props: {}) { diff --git a/src/views/Firewall/Firewall.tsx b/src/views/Firewall/Firewall.tsx index 7d4d8daf74..f599fdafff 100644 --- a/src/views/Firewall/Firewall.tsx +++ b/src/views/Firewall/Firewall.tsx @@ -16,19 +16,19 @@ */ import * as React from "react"; -import * as moment from "moment"; -import * as data from "data"; -import { post, put, del } from "requests"; -import { deepCompare, errorAlerter } from "misc"; -import { PaginatedTable } from "PaginatedTable"; -import { Player } from "Player"; -import { alert } from "swal_config"; +import moment from "moment"; +import * as data from "@/lib/data"; +import { post, put, del } from "@/lib/requests"; +import { deepCompare, errorAlerter } from "@/lib/misc"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import { Player } from "@/components/Player"; +import { alert } from "@/lib/swal_config"; /* -import { Card } from "material"; -import { SearchInput } from "misc-ui"; -import { Player } from "Player"; -import * as moment from "moment"; -import { chat_markup } from "Chat"; +import { Card } from "@/components/material"; +import { SearchInput } from "@/components/misc-ui"; +import { Player } from "@/components/Player"; +import moment from "moment"; +import { chat_markup } from "@/components/Chat"; */ type Operator = "EQUALS" | "GREATER_THAN" | "LESS_THAN" | "REGEX_MATCHES" | "OR" | "AND"; diff --git a/src/views/ForceUsernameChange/ForceUsernameChange.tsx b/src/views/ForceUsernameChange/ForceUsernameChange.tsx index 5a5c4b64bb..59c1c8df76 100644 --- a/src/views/ForceUsernameChange/ForceUsernameChange.tsx +++ b/src/views/ForceUsernameChange/ForceUsernameChange.tsx @@ -16,12 +16,12 @@ */ import * as React from "react"; -import * as data from "data"; -import { _ } from "translate"; -import { Card } from "material"; -import { errorAlerter } from "misc"; -import { put } from "requests"; -import { cached } from "cached"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; +import { Card } from "@/components/material"; +import { errorAlerter } from "@/lib/misc"; +import { put } from "@/lib/requests"; +import { cached } from "@/lib/cached"; export function ForceUsernameChange(): JSX.Element { const user = data.get("config.user"); diff --git a/src/views/Game/AIDemoReview.tsx b/src/views/Game/AIDemoReview.tsx index f3d0d1f23f..7f80e7c5d1 100644 --- a/src/views/Game/AIDemoReview.tsx +++ b/src/views/Game/AIDemoReview.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import { pgettext, interpolate } from "translate"; -import { ai_socket } from "sockets"; -import { Toggle } from "Toggle"; -import { uuid } from "misc"; -import * as preferences from "preferences"; -import { usePreference } from "preferences"; +import { pgettext, interpolate } from "@/lib/translate"; +import { ai_socket } from "@/lib/sockets"; +import { Toggle } from "@/components/Toggle"; +import { uuid } from "@/lib/misc"; +import * as preferences from "@/lib/preferences"; +import { usePreference } from "@/lib/preferences"; import { JGOFNumericPlayerColor, ColoredCircle, MoveTree, GobanRenderer } from "goban"; -import { useUser } from "hooks"; +import { useUser } from "@/lib/hooks"; const cached_data: { [review_id: number]: { [board_string: string]: any } } = {}; diff --git a/src/views/Game/AIReview.tsx b/src/views/Game/AIReview.tsx index dd01cc0beb..c8089f195e 100644 --- a/src/views/Game/AIReview.tsx +++ b/src/views/Game/AIReview.tsx @@ -15,22 +15,22 @@ * along with this program. If not, see . */ -import * as moment from "moment"; +import moment from "moment"; import * as React from "react"; -import * as data from "data"; -import * as preferences from "preferences"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; import Select, { components } from "react-select"; -import { UIPush } from "UIPush"; -import { AIReviewStream, ai_request_variation_analysis } from "AIReviewStream"; -import { openBecomeASiteSupporterModal } from "Supporter"; -import { errorAlerter, errorLogger, Timeout } from "misc"; -import { toast } from "toast"; -import { get, post } from "requests"; -import { _, pgettext, interpolate } from "translate"; -import { close_all_popovers } from "popover"; -import { Errcode } from "Errcode"; +import { UIPush } from "@/components/UIPush"; +import { AIReviewStream, ai_request_variation_analysis } from "@/components/AIReviewStream"; +import { openBecomeASiteSupporterModal } from "@/views/Supporter"; +import { errorAlerter, errorLogger, Timeout } from "@/lib/misc"; +import { toast } from "@/lib/toast"; +import { get, post } from "@/lib/requests"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import { close_all_popovers } from "@/lib/popover"; +import { Errcode } from "@/components/Errcode"; import { AIReviewChart } from "./AIReviewChart"; -import { Toggle } from "Toggle"; +import { Toggle } from "@/components/Toggle"; import { MoveTree, JGOFAIReview, @@ -45,7 +45,7 @@ import { encodeMove, } from "goban"; import { game_control } from "./game_control"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import { GobanContext } from "./goban_context"; export interface AIReviewEntry { move_number: number; diff --git a/src/views/Game/AIReviewChart.tsx b/src/views/Game/AIReviewChart.tsx index c32193494f..23dfdacb36 100644 --- a/src/views/Game/AIReviewChart.tsx +++ b/src/views/Game/AIReviewChart.tsx @@ -18,11 +18,11 @@ import * as d3 from "d3"; import * as React from "react"; import * as JSNoise from "js-noise"; -import * as data from "data"; -import { OgsResizeDetector } from "OgsResizeDetector"; +import * as data from "@/lib/data"; +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; import { AIReviewEntry } from "./AIReview"; -import { PersistentElement } from "PersistentElement"; -import { deepCompare } from "misc"; +import { PersistentElement } from "@/components/PersistentElement"; +import { deepCompare } from "@/lib/misc"; import { JGOFAIReview } from "goban"; window["d3"] = d3; diff --git a/src/views/Game/AntiGrief.tsx b/src/views/Game/AntiGrief.tsx index ea2d45fb94..303110f90a 100644 --- a/src/views/Game/AntiGrief.tsx +++ b/src/views/Game/AntiGrief.tsx @@ -16,14 +16,14 @@ */ import * as React from "react"; -import * as data from "data"; -import { Card } from "material"; -import { pgettext, _ } from "translate"; +import * as data from "@/lib/data"; +import { Card } from "@/components/material"; +import { pgettext, _ } from "@/lib/translate"; import { useGoban } from "./goban_context"; -import { useUser } from "hooks"; +import { useUser } from "@/lib/hooks"; import { JGOFClockWithTransmitting, JGOFTimeControl } from "goban"; -import { browserHistory } from "../../ogsHistory"; -import { toast } from "toast"; +import { browserHistory } from "@/lib/ogsHistory"; +import { toast } from "@/lib/toast"; import { StallingScoreEstimate } from "goban"; const ANTI_ESCAPING_TIMEOUT = 60; // number of seconds to wait before allowing the "Claim victory" button to be appear and be clicked diff --git a/src/views/Game/BotDetectionResults.tsx b/src/views/Game/BotDetectionResults.tsx index 0bbb2f1c75..c26d8afea7 100644 --- a/src/views/Game/BotDetectionResults.tsx +++ b/src/views/Game/BotDetectionResults.tsx @@ -16,8 +16,8 @@ */ import * as React from "react"; -import { Player } from "Player"; -import { put } from "requests"; +import { Player } from "@/components/Player"; +import { put } from "@/lib/requests"; interface PlayerData { color: string; diff --git a/src/views/Game/ConditionalMoveTreeDisplay.tsx b/src/views/Game/ConditionalMoveTreeDisplay.tsx index 33cde230ca..42179f7534 100644 --- a/src/views/Game/ConditionalMoveTreeDisplay.tsx +++ b/src/views/Game/ConditionalMoveTreeDisplay.tsx @@ -19,7 +19,7 @@ import * as React from "react"; import { ConditionalMoveTree } from "goban"; import { useGoban } from "./goban_context"; import { generateGobanHook } from "./GameHooks"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; interface ConditionalMoveTreeDisplayProps { tree: ConditionalMoveTree; diff --git a/src/views/Game/Game.tsx b/src/views/Game/Game.tsx index 720ac35516..132d99118a 100644 --- a/src/views/Game/Game.tsx +++ b/src/views/Game/Game.tsx @@ -18,15 +18,15 @@ import * as React from "react"; import { useParams, useLocation, useSearchParams } from "react-router-dom"; -import * as data from "data"; -import * as preferences from "preferences"; -import { browserHistory } from "ogsHistory"; -import { _, interpolate, current_language } from "translate"; -import { popover } from "popover"; -import { post, get, abort_requests_in_flight } from "requests"; -import { KBShortcut } from "KBShortcut"; -import { UIPush } from "UIPush"; -import { errorAlerter, ignore, rulesText } from "misc"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, interpolate, current_language } from "@/lib/translate"; +import { popover } from "@/lib/popover"; +import { post, get, abort_requests_in_flight } from "@/lib/requests"; +import { KBShortcut } from "@/components/KBShortcut"; +import { UIPush } from "@/components/UIPush"; +import { errorAlerter, ignore, rulesText } from "@/lib/misc"; import { createGoban, GobanRenderer, @@ -41,13 +41,13 @@ import { JGOFSealingIntersection, encodeMove, } from "goban"; -import { isLiveGame } from "TimeControl"; -import { setExtraActionCallback, PlayerDetails } from "Player"; -import * as player_cache from "player_cache"; -import { notification_manager } from "Notifications"; -import { Resizable } from "Resizable"; -import { chat_manager, ChatChannelProxy, inGameModChannel } from "chat_manager"; -import { sfx, SFXSprite, ValidSound } from "sfx"; +import { isLiveGame } from "@/components/TimeControl"; +import { setExtraActionCallback, PlayerDetails } from "@/components/Player"; +import * as player_cache from "@/lib/player_cache"; +import { notification_manager } from "@/components/Notifications"; +import { Resizable } from "@/components/Resizable"; +import { chat_manager, ChatChannelProxy, inGameModChannel } from "@/lib/chat_manager"; +import { sfx, SFXSprite, ValidSound } from "@/lib/sfx"; import { AIReview } from "./AIReview"; import { AIDemoReview } from "./AIDemoReview"; import { GameChat, ChatMode } from "./GameChat"; @@ -67,14 +67,14 @@ import { } from "./PlayControls"; import { CancelButton } from "./PlayButtons"; import { GameDock } from "./GameDock"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import { useCurrentMove, useShowTitle, useTitle, useUserIsParticipant } from "./GameHooks"; -import { GobanContainer } from "GobanContainer"; +import { GobanContainer } from "@/components/GobanContainer"; import { GobanContext } from "./goban_context"; -import { is_valid_url } from "url_validation"; +import { is_valid_url } from "@/lib/url_validation"; import { disableTouchAction, enableTouchAction } from "./touch_actions"; import { BotDetectionResults } from "./BotDetectionResults"; -import { ActiveTournament } from "src/lib/types"; +import { ActiveTournament } from "@/lib/types"; export function Game(): JSX.Element | null { const params = useParams<"game_id" | "review_id" | "move_number">(); diff --git a/src/views/Game/GameChat.tsx b/src/views/Game/GameChat.tsx index 6766872dfe..0cc04ab242 100644 --- a/src/views/Game/GameChat.tsx +++ b/src/views/Game/GameChat.tsx @@ -15,20 +15,20 @@ * along with this program. If not, see . */ -import * as data from "data"; -import * as preferences from "preferences"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; import * as React from "react"; -import * as moment from "moment"; -import { LineText } from "misc-ui"; +import moment from "moment"; +import { LineText } from "@/components/misc-ui"; import { Link } from "react-router-dom"; -import { _, pgettext, interpolate, current_language } from "translate"; -import { Player } from "Player"; -import { profanity_filter } from "profanity_filter"; +import { _, pgettext, interpolate, current_language } from "@/lib/translate"; +import { Player } from "@/components/Player"; +import { profanity_filter } from "@/lib/profanity_filter"; import { GobanRenderer, Goban, protocol } from "goban"; -import { ChatUserList, ChatUserCount } from "ChatUserList"; -import { TabCompleteInput } from "TabCompleteInput"; -import { chat_markup } from "components/Chat"; -import { inGameModChannel } from "chat_manager"; +import { ChatUserList, ChatUserCount } from "@/components/ChatUserList"; +import { TabCompleteInput } from "@/components/TabCompleteInput"; +import { chat_markup } from "@/components/Chat"; +import { inGameModChannel } from "@/lib/chat_manager"; import { MoveTree } from "goban"; import { game_control } from "./game_control"; import { useUserIsParticipant } from "./GameHooks"; diff --git a/src/views/Game/GameDock.test.tsx b/src/views/Game/GameDock.test.tsx index df27238c0a..75e582bf01 100644 --- a/src/views/Game/GameDock.test.tsx +++ b/src/views/Game/GameDock.test.tsx @@ -9,7 +9,7 @@ import { GameDock } from "./GameDock"; import { createGoban } from "goban"; import { GobanContext } from "./goban_context"; import { BrowserRouter as Router } from "react-router-dom"; -import * as data from "data"; +import * as data from "@/lib/data"; const TEST_USER = { anonymous: false, diff --git a/src/views/Game/GameDock.tsx b/src/views/Game/GameDock.tsx index 5d82f4a598..b3d490e6fc 100644 --- a/src/views/Game/GameDock.tsx +++ b/src/views/Game/GameDock.tsx @@ -16,24 +16,24 @@ */ import * as React from "react"; -import * as data from "data"; -import * as preferences from "preferences"; -import { MAX_DOCK_DELAY } from "SettingsCommon"; -import { useUser } from "hooks"; -import { api1, post, del } from "requests"; -import { Dock } from "Dock"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import { MAX_DOCK_DELAY } from "@/lib/SettingsCommon"; +import { useUser } from "@/lib/hooks"; +import { api1, post, del } from "@/lib/requests"; +import { Dock } from "@/components/Dock"; import { Link } from "react-router-dom"; -import { toast } from "toast"; -import { _, pgettext } from "translate"; -import { openACLModal } from "ACLModal"; +import { toast } from "@/lib/toast"; +import { _, pgettext } from "@/lib/translate"; +import { openACLModal } from "@/components/ACLModal"; import { openGameLinkModal } from "./GameLinkModal"; import { openGameLogModal } from "./GameLogModal"; -import { sfx } from "sfx"; -import { alert } from "swal_config"; -import { challengeFromBoardPosition } from "ChallengeModal/ForkModal"; -import { errorAlerter } from "misc"; -import { doAnnul } from "moderation"; -import { openReport } from "Report"; +import { sfx } from "@/lib/sfx"; +import { alert } from "@/lib/swal_config"; +import { challengeFromBoardPosition } from "@/components/ChallengeModal/ForkModal"; +import { errorAlerter } from "@/lib/misc"; +import { doAnnul } from "@/lib/moderation"; +import { openReport } from "@/components/Report"; import { game_control } from "./game_control"; import { openGameInfoModal } from "./GameInfoModal"; import { useUserIsParticipant } from "./GameHooks"; diff --git a/src/views/Game/GameHooks.ts b/src/views/Game/GameHooks.ts index 8e4604f93e..7c8b00235b 100644 --- a/src/views/Game/GameHooks.ts +++ b/src/views/Game/GameHooks.ts @@ -19,7 +19,7 @@ import * as React from "react"; import { Goban } from "goban"; import { game_control } from "./game_control"; import { GobanEvents } from "goban"; -import * as data from "data"; +import * as data from "@/lib/data"; /** * Generates a custom react hook that can return a prop that is derived from a diff --git a/src/views/Game/GameInfoModal.tsx b/src/views/Game/GameInfoModal.tsx index 0cc92988f4..513a1fbb9e 100644 --- a/src/views/Game/GameInfoModal.tsx +++ b/src/views/Game/GameInfoModal.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import * as moment from "moment"; -import * as data from "data"; -import { _ } from "translate"; -import { post, patch, del } from "requests"; -import { openModal, Modal, ModalConstructorInput } from "Modal"; -import { timeControlDescription } from "TimeControl"; -import { Player } from "Player"; -import { handicapText } from "GameAcceptModal"; -import { errorAlerter, rulesText, yesno, getGameResultText } from "misc"; -import { rankString } from "rank_utils"; -import { browserHistory } from "ogsHistory"; -import { alert } from "swal_config"; +import moment from "moment"; +import * as data from "@/lib/data"; +import { _ } from "@/lib/translate"; +import { post, patch, del } from "@/lib/requests"; +import { openModal, Modal, ModalConstructorInput } from "@/components/Modal"; +import { timeControlDescription } from "@/components/TimeControl"; +import { Player } from "@/components/Player"; +import { handicapText } from "@/components/GameAcceptModal"; +import { errorAlerter, rulesText, yesno, getGameResultText } from "@/lib/misc"; +import { rankString } from "@/lib/rank_utils"; +import { browserHistory } from "@/lib/ogsHistory"; +import { alert } from "@/lib/swal_config"; import { GobanConfig, GobanEnginePlayerEntry, GobanEngineRules } from "goban"; interface Events {} diff --git a/src/views/Game/GameLinkModal.tsx b/src/views/Game/GameLinkModal.tsx index 50c7d716d8..f574593e9b 100644 --- a/src/views/Game/GameLinkModal.tsx +++ b/src/views/Game/GameLinkModal.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { pgettext, _ } from "translate"; -import { openModal, Modal } from "Modal"; +import { pgettext, _ } from "@/lib/translate"; +import { openModal, Modal } from "@/components/Modal"; import { GobanRenderer } from "goban"; -import { Player } from "Player"; +import { Player } from "@/components/Player"; interface Events {} diff --git a/src/views/Game/GameLog.tsx b/src/views/Game/GameLog.tsx index 8eb01c481e..59a19b1645 100644 --- a/src/views/Game/GameLog.tsx +++ b/src/views/Game/GameLog.tsx @@ -15,16 +15,16 @@ * along with this program. If not, see . */ import * as React from "react"; -import * as moment from "moment"; +import moment from "moment"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import * as DynamicHelp from "react-dynamic-help"; -import { LogEntry } from "Game"; +import { LogEntry } from "@/views/Game"; import { GobanEngineConfig } from "goban"; -import { socket } from "sockets"; -import { Player } from "Player"; +import { socket } from "@/lib/sockets"; +import { Player } from "@/components/Player"; import { ScoringEventThumbnail } from "./ScoringEventThumbnail"; const TRUNCATED_GAME_LOG_LENGTH = 25; @@ -44,10 +44,8 @@ export function GameLog({ const [shouldDisplayFullLog, setShouldDisplayFullLog] = React.useState(false); const { registerTargetItem } = React.useContext(DynamicHelp.Api); + const { ref: autoscoreRef } = registerTargetItem("autoscore-game-log-entry"); - // Defend against the case where we aren't wrapped in a help provider: in a Modal - // TBD: made Modals be able to use the help provider - const autoscoreRef = registerTargetItem?.("autoscore-game-log-entry")?.ref || null; const game_id = goban_config.game_id as number; let firstAutoscoringEntryRendered = false; diff --git a/src/views/Game/GameLogModal.tsx b/src/views/Game/GameLogModal.tsx index 21cea13f67..f9e68f2bbe 100644 --- a/src/views/Game/GameLogModal.tsx +++ b/src/views/Game/GameLogModal.tsx @@ -17,10 +17,10 @@ import * as React from "react"; -import { _ } from "translate"; -import { openModal, Modal } from "Modal"; -import { Player } from "Player"; -import { socket } from "sockets"; +import { _ } from "@/lib/translate"; +import { openModal, Modal } from "@/components/Modal"; +import { Player } from "@/components/Player"; +import { socket } from "@/lib/sockets"; import { GameLog } from "./GameLog"; interface Events {} diff --git a/src/views/Game/GameTimings.tsx b/src/views/Game/GameTimings.tsx index fac69dd436..d480525280 100644 --- a/src/views/Game/GameTimings.tsx +++ b/src/views/Game/GameTimings.tsx @@ -15,14 +15,14 @@ * along with this program. If not, see . */ -import * as moment from "moment"; +import moment from "moment"; import "moment-duration-format"; import * as React from "react"; import { AdHocPackedMove, GobanMovesArray } from "goban"; -import { useUser } from "hooks"; -import { showSecondsResolution } from "misc"; +import { useUser } from "@/lib/hooks"; +import { showSecondsResolution } from "@/lib/misc"; interface GameTimingProperties { moves: GobanMovesArray; diff --git a/src/views/Game/PlayButtons.test.tsx b/src/views/Game/PlayButtons.test.tsx index c03a4a8e51..2dfced19e4 100644 --- a/src/views/Game/PlayButtons.test.tsx +++ b/src/views/Game/PlayButtons.test.tsx @@ -7,9 +7,9 @@ import { AdHocPackedMove, createGoban, GobanRenderer } from "goban"; import { CancelButton, PlayButtons } from "./PlayButtons"; import { act, cleanup, fireEvent, render, screen /* waitFor */ } from "@testing-library/react"; import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { GobanContext } from "./goban_context"; -import { OgsHelpProvider } from "OgsHelpProvider"; +import { OgsHelpProvider } from "@/components/OgsHelpProvider"; const LOGGED_IN_USER = { anonymous: false, diff --git a/src/views/Game/PlayButtons.tsx b/src/views/Game/PlayButtons.tsx index 341604851d..ef28740390 100644 --- a/src/views/Game/PlayButtons.tsx +++ b/src/views/Game/PlayButtons.tsx @@ -16,12 +16,12 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { isLiveGame } from "TimeControl"; -import * as preferences from "preferences"; -import * as data from "data"; +import { _ } from "@/lib/translate"; +import { isLiveGame } from "@/components/TimeControl"; +import * as preferences from "@/lib/preferences"; +import * as data from "@/lib/data"; import { game_control } from "./game_control"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import { useCurrentMoveNumber, usePlayerToMove, useShowUndoRequested } from "./GameHooks"; import { useGoban } from "./goban_context"; import * as DynamicHelp from "react-dynamic-help"; diff --git a/src/views/Game/PlayControls.test.tsx b/src/views/Game/PlayControls.test.tsx index abf855a0d0..0e85764c85 100644 --- a/src/views/Game/PlayControls.test.tsx +++ b/src/views/Game/PlayControls.test.tsx @@ -7,11 +7,11 @@ import { createGoban, GobanRenderer, ConditionalMoveTree } from "goban"; import { PlayControls } from "./PlayControls"; import { render, screen } from "@testing-library/react"; import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { MemoryRouter as Router } from "react-router-dom"; import { GobanContext } from "./goban_context"; import { act } from "react-dom/test-utils"; -import { OgsHelpProvider } from "OgsHelpProvider"; +import { OgsHelpProvider } from "@/components/OgsHelpProvider"; const TEST_USER = { anonymous: false, id: 123, diff --git a/src/views/Game/PlayControls.tsx b/src/views/Game/PlayControls.tsx index 02da252fd6..897f4970fd 100644 --- a/src/views/Game/PlayControls.tsx +++ b/src/views/Game/PlayControls.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; import { useSearchParams } from "react-router-dom"; -import { _, interpolate, pgettext } from "translate"; +import { _, interpolate, pgettext } from "@/lib/translate"; import * as DynamicHelp from "react-dynamic-help"; -import * as data from "data"; -import * as preferences from "preferences"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; import { ConditionalMoveResponseTree, GobanRenderer, @@ -35,18 +35,18 @@ import { color_blend, } from "goban"; import { game_control } from "./game_control"; -import { alert } from "swal_config"; -import { challengeRematch } from "ChallengeModal"; -import { Clock } from "Clock"; -import { getOutcomeTranslation } from "misc"; -import { PlayerCacheEntry } from "player_cache"; +import { alert } from "@/lib/swal_config"; +import { challengeRematch } from "@/components/ChallengeModal"; +import { Clock } from "@/components/Clock"; +import { getOutcomeTranslation } from "@/lib/misc"; +import { PlayerCacheEntry } from "@/lib/player_cache"; import { Link } from "react-router-dom"; -import { Resizable } from "Resizable"; +import { Resizable } from "@/components/Resizable"; import { ChatMode } from "./GameChat"; -import { toast } from "toast"; -import { errorAlerter } from "misc"; -import { close_all_popovers } from "popover"; -import { setExtraActionCallback, Player } from "Player"; +import { toast } from "@/lib/toast"; +import { errorAlerter } from "@/lib/misc"; +import { close_all_popovers } from "@/lib/popover"; +import { setExtraActionCallback, Player } from "@/components/Player"; import { PlayButtons } from "./PlayButtons"; import { generateGobanHook, @@ -57,13 +57,13 @@ import { usePlayerToMove, } from "./GameHooks"; import { useGoban } from "./goban_context"; -import { is_valid_url } from "url_validation"; +import { is_valid_url } from "@/lib/url_validation"; import { enableTouchAction } from "./touch_actions"; import { ConditionalMoveTreeDisplay } from "./ConditionalMoveTreeDisplay"; -import { useUser } from "hooks"; +import { useUser } from "@/lib/hooks"; import { AntiGrief } from "./AntiGrief"; -import * as moment from "moment"; +import moment from "moment"; const MAX_SEALING_LOCATIONS_TO_LIST = 5; diff --git a/src/views/Game/PlayerCards.test.tsx b/src/views/Game/PlayerCards.test.tsx index 8f48e16421..6a7907bd4c 100644 --- a/src/views/Game/PlayerCards.test.tsx +++ b/src/views/Game/PlayerCards.test.tsx @@ -9,7 +9,7 @@ import { PlayerCard } from "./PlayerCards"; import { createGoban } from "goban"; import { GobanContext } from "./goban_context"; import { BrowserRouter as Router } from "react-router-dom"; -import * as data from "data"; +import * as data from "@/lib/data"; const TEST_USER = { anonymous: false, diff --git a/src/views/Game/PlayerCards.tsx b/src/views/Game/PlayerCards.tsx index 3e483a7561..f151f8675c 100644 --- a/src/views/Game/PlayerCards.tsx +++ b/src/views/Game/PlayerCards.tsx @@ -16,26 +16,26 @@ */ import * as React from "react"; -import { get } from "requests"; +import { get } from "@/lib/requests"; import { GobanRenderer, Goban, PlayerScore, JGOFPlayerSummary } from "goban"; -import { icon_size_url } from "PlayerIcon"; +import { icon_size_url } from "@/components/PlayerIcon"; import { CountDown } from "./CountDown"; -import { Flag } from "Flag"; -import { ChatPresenceIndicator } from "ChatPresenceIndicator"; -import { Clock } from "Clock"; -import { useUser } from "hooks"; -import { Player } from "Player"; -import { lookup, fetch } from "player_cache"; -import { _, interpolate, ngettext } from "translate"; -import * as data from "data"; +import { Flag } from "@/components/Flag"; +import { ChatPresenceIndicator } from "@/components/ChatPresenceIndicator"; +import { Clock } from "@/components/Clock"; +import { useUser } from "@/lib/hooks"; +import { Player } from "@/components/Player"; +import { lookup, fetch } from "@/lib/player_cache"; +import { _, interpolate, ngettext } from "@/lib/translate"; +import * as data from "@/lib/data"; import { generateGobanHook, usePlayerToMove } from "./GameHooks"; -import { get_network_latency, get_clock_drift } from "sockets"; +import { get_network_latency, get_clock_drift } from "@/lib/sockets"; import { useGoban } from "./goban_context"; -import { usePreference } from "preferences"; -import { browserHistory } from "ogsHistory"; -import { player_is_ignored } from "BlockPlayer"; -import { doAnnul } from "moderation"; +import { usePreference } from "@/lib/preferences"; +import { browserHistory } from "@/lib/ogsHistory"; +import { player_is_ignored } from "@/components/BlockPlayer"; +import { doAnnul } from "@/lib/moderation"; import moment from "moment"; type PlayerType = rest_api.games.Player; diff --git a/src/views/Game/game_control.ts b/src/views/Game/game_control.ts index c317ae7304..f5f42f3a9e 100644 --- a/src/views/Game/game_control.ts +++ b/src/views/Game/game_control.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { TypedEventEmitter } from "TypedEventEmitter"; +import { TypedEventEmitter } from "@/lib/TypedEventEmitter"; interface Events { stopEstimatingScore: void; // emitted when we want to stop estimating the score diff --git a/src/views/Game/tree-lastnode.png b/src/views/Game/tree-lastnode.png index f8809f80226b5b355de607adab481e0d2a98833f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^96&6>$P6UAuD;U%QfvV}A+8L}3>_UEvNtA_0Yw-~ zg8YIR9G=}s19CVEJR*x37`TN&n2}-D90{Nxdx@v7EBiGLHW3abX}iYrKp_E77sn8e j>&Y1j4(gTe~DWM4fSK1-d diff --git a/src/views/Game/tree-node.png b/src/views/Game/tree-node.png index 29f6c446045ada93d886de10a85dcbf7c686cc48..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^96&6>$P6UAuD;U%QfvV}A+8L}3>_UEvNtA_0Yw-~ zg8YIR9G=}s19CVEJR*x37`TN&n2}-D90{Nxdx@v7EBiGLHW3ch)+mu2ppc-ai(?4K k_2i5MhxY%H21lhBE=}fY@LT011C(U&boFyt=akR{0Bd3)YXATM diff --git a/src/views/Game/tree-vline.png b/src/views/Game/tree-vline.png index 4c9bc6d749a5c5d6b34202e17dd06f1d790d024c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrA$P6U?WtMRQDdqs55Z8{5j)>H}%|I?^fk$L9 z0|U1(2s1Lwnj--eWH0gbb!ETC!6qy$$>y{53s8vL)5S4_<9c$!0Tu=Z5eCMmZ5zCR O!VI3SelF{r5}E))DH%rq diff --git a/src/views/Game/util.ts b/src/views/Game/util.ts index 4040a656f7..1f39a3992e 100644 --- a/src/views/Game/util.ts +++ b/src/views/Game/util.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { socket } from "sockets"; +import { socket } from "@/lib/sockets"; const win = $(window); diff --git a/src/views/GameEmbed/GameEmbed.tsx b/src/views/GameEmbed/GameEmbed.tsx index fa6c4c4e5d..60e319c5bc 100644 --- a/src/views/GameEmbed/GameEmbed.tsx +++ b/src/views/GameEmbed/GameEmbed.tsx @@ -21,8 +21,8 @@ import * as React from "react"; import { useParams, useSearchParams } from "react-router-dom"; -import { useResizeDetector } from "OgsResizeDetector"; -import { MiniGoban } from "MiniGoban"; +import { useResizeDetector } from "@/components/OgsResizeDetector"; +import { MiniGoban } from "@/components/MiniGoban"; // For the layout, this seems to give just enough room for the point tally on // the right and left. diff --git a/src/views/GoTV/GoTV.tsx b/src/views/GoTV/GoTV.tsx index 0509f10f00..185721bebe 100644 --- a/src/views/GoTV/GoTV.tsx +++ b/src/views/GoTV/GoTV.tsx @@ -17,10 +17,10 @@ import React, { useState, useEffect, useRef } from "react"; import { StreamCard } from "./StreamCard"; -import { _ } from "translate"; -import * as preferences from "preferences"; +import { _ } from "@/lib/translate"; +import * as preferences from "@/lib/preferences"; import { Stream, streamManager } from "./StreamManager"; -import { GoTVPreferences } from "Settings"; +import { GoTVPreferences } from "@/views/Settings"; import { useLocation } from "react-router-dom"; let twitch_js_promise: Promise | null = null; diff --git a/src/views/GoTV/GoTVIndicator.tsx b/src/views/GoTV/GoTVIndicator.tsx index 41f720e602..6c56089971 100644 --- a/src/views/GoTV/GoTVIndicator.tsx +++ b/src/views/GoTV/GoTVIndicator.tsx @@ -17,7 +17,7 @@ import React, { useEffect, useState } from "react"; import { Link, useLocation } from "react-router-dom"; -import * as preferences from "preferences"; +import * as preferences from "@/lib/preferences"; import { Stream, streamManager } from "./StreamManager"; import { GoTVNotifier } from "./GoTVNotifier"; diff --git a/src/views/GoTV/GoTVNotification.tsx b/src/views/GoTV/GoTVNotification.tsx index e5fd4eaecf..e3c7ab90a8 100644 --- a/src/views/GoTV/GoTVNotification.tsx +++ b/src/views/GoTV/GoTVNotification.tsx @@ -16,7 +16,7 @@ */ import React, { useEffect, useState } from "react"; -import { _, interpolate } from "translate"; +import { _, interpolate } from "@/lib/translate"; interface GoTVNotificationProps { streamId: string; diff --git a/src/views/GoTV/GoTVNotifier.tsx b/src/views/GoTV/GoTVNotifier.tsx index 06a5f28a66..37b6b2c01e 100644 --- a/src/views/GoTV/GoTVNotifier.tsx +++ b/src/views/GoTV/GoTVNotifier.tsx @@ -17,10 +17,10 @@ import React, { useEffect, useState } from "react"; import { Stream } from "./StreamManager"; -import { usePreference } from "preferences"; +import { usePreference } from "@/lib/preferences"; import { GoTVNotification } from "./GoTVNotification"; import { useNavigate } from "react-router-dom"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; interface Notification { streamId: string; diff --git a/src/views/GoTV/StreamManager.ts b/src/views/GoTV/StreamManager.ts index ff3ababa9b..3fb08cb3c6 100644 --- a/src/views/GoTV/StreamManager.ts +++ b/src/views/GoTV/StreamManager.ts @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -import { get } from "requests"; -import * as preferences from "preferences"; +import { get } from "@/lib/requests"; +import * as preferences from "@/lib/preferences"; import { EventEmitter } from "eventemitter3"; -import { socket } from "sockets"; +import { socket } from "@/lib/sockets"; interface StreamEvents { update: (streams: Stream[]) => void; diff --git a/src/views/GoTV/useTwitchIntegration.ts b/src/views/GoTV/useTwitchIntegration.ts index 9460474c26..2eceec9d34 100644 --- a/src/views/GoTV/useTwitchIntegration.ts +++ b/src/views/GoTV/useTwitchIntegration.ts @@ -16,7 +16,7 @@ */ import { useState, useEffect } from "react"; -import { usePreference } from "preferences"; +import { usePreference } from "@/lib/preferences"; // Client ID will need to be the OGS client ID, probably from environment variable? // Redirect URI also needs to match the allowed redirect URIs in the console at dev.twitch.tv diff --git a/src/views/Group/Group.tsx b/src/views/Group/Group.tsx index 6411674468..c2df50be64 100644 --- a/src/views/Group/Group.tsx +++ b/src/views/Group/Group.tsx @@ -17,29 +17,29 @@ import * as React from "react"; import { Link } from "react-router-dom"; -import { RouteComponentProps, rr6ClassShim } from "ogs-rr6-shims"; -import { browserHistory } from "ogsHistory"; -import { _, interpolate, pgettext } from "translate"; -import { post, del, put, get } from "requests"; -import { errorAlerter, slugify, rulesText } from "misc"; -import * as data from "data"; -import { Card } from "material"; -import { Player, setExtraActionCallback } from "Player"; -import { PaginatedTable, PaginatedTableRef } from "PaginatedTable"; -import { Markdown } from "Markdown"; -import { UIPush } from "UIPush"; -import { TournamentList } from "TournamentList"; -import { close_all_popovers } from "popover"; -import * as player_cache from "player_cache"; +import { RouteComponentProps, rr6ClassShim } from "@/lib/ogs-rr6-shims"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, interpolate, pgettext } from "@/lib/translate"; +import { post, del, put, get } from "@/lib/requests"; +import { errorAlerter, slugify, rulesText } from "@/lib/misc"; +import * as data from "@/lib/data"; +import { Card } from "@/components/material"; +import { Player, setExtraActionCallback } from "@/components/Player"; +import { PaginatedTable, PaginatedTableRef } from "@/components/PaginatedTable"; +import { Markdown } from "@/components/Markdown"; +import { UIPush } from "@/components/UIPush"; +import { TournamentList } from "@/views/TournamentList"; +import { close_all_popovers } from "@/lib/popover"; +import * as player_cache from "@/lib/player_cache"; import Dropzone from "react-dropzone"; -import { image_resizer } from "image_resizer"; -import * as moment from "moment"; -import { PlayerAutocomplete } from "PlayerAutocomplete"; -import { EmbeddedChatCard } from "Chat"; -import { localize_time_strings } from "localize-time"; -import { alert } from "swal_config"; -import { PlayerCacheEntry } from "player_cache"; -import { is_valid_url } from "url_validation"; +import { image_resizer } from "@/lib/image_resizer"; +import moment from "moment"; +import { PlayerAutocomplete } from "@/components/PlayerAutocomplete"; +import { EmbeddedChatCard } from "@/components/Chat"; +import { localize_time_strings } from "@/lib/localize-time"; +import { alert } from "@/lib/swal_config"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +import { is_valid_url } from "@/lib/url_validation"; type GroupProperties = RouteComponentProps<{ group_id: string; diff --git a/src/views/GroupCreate/GroupCreate.tsx b/src/views/GroupCreate/GroupCreate.tsx index c930a4a4b6..b5cdfa1e1a 100644 --- a/src/views/GroupCreate/GroupCreate.tsx +++ b/src/views/GroupCreate/GroupCreate.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { post } from "requests"; -import { errorAlerter } from "misc"; -import { browserHistory } from "ogsHistory"; +import { _ } from "@/lib/translate"; +import { post } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { browserHistory } from "@/lib/ogsHistory"; interface GroupCreateState { name: string; diff --git a/src/views/GroupList/GroupList.tsx b/src/views/GroupList/GroupList.tsx index 5687bc95ab..517cbd9736 100644 --- a/src/views/GroupList/GroupList.tsx +++ b/src/views/GroupList/GroupList.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { Link } from "react-router-dom"; -import { _ } from "translate"; -import { PaginatedTable } from "PaginatedTable"; -import { SearchInput } from "misc-ui"; -import { navigateTo } from "misc"; -import { useUser } from "hooks"; +import { _ } from "@/lib/translate"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import { SearchInput } from "@/components/misc-ui"; +import { navigateTo } from "@/lib/misc"; +import { useUser } from "@/lib/hooks"; export function GroupList(): JSX.Element { const user = useUser(); diff --git a/src/views/HelpFlows/CommunityModeratorIntro.tsx b/src/views/HelpFlows/CommunityModeratorIntro.tsx index 26ec3abf4b..d5d63d3cc1 100644 --- a/src/views/HelpFlows/CommunityModeratorIntro.tsx +++ b/src/views/HelpFlows/CommunityModeratorIntro.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; /** * Help flows for people who just got Community Moderator powers diff --git a/src/views/HelpFlows/GameLogHelp.tsx b/src/views/HelpFlows/GameLogHelp.tsx index fa6fcb0c87..50f2590f6e 100644 --- a/src/views/HelpFlows/GameLogHelp.tsx +++ b/src/views/HelpFlows/GameLogHelp.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { llm_pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; /** * A help flow intended for moderators and CMs wondering about mysterious auto score entries @@ -30,13 +30,12 @@ export function GameLogHelp(): JSX.Element {
- {llm_pgettext( - "", + {_( "These come from the user's browser during autoscoring. Two of these from each user, at the beginning of the scoring phase, and if the users presses 'auto-score'", )}
diff --git a/src/views/HelpFlows/GuestUserIntro.tsx b/src/views/HelpFlows/GuestUserIntro.tsx index 0eb1fa0b17..b8871e25ab 100644 --- a/src/views/HelpFlows/GuestUserIntro.tsx +++ b/src/views/HelpFlows/GuestUserIntro.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; /** * A help flow intended for guests who arrived on a Challenge Link diff --git a/src/views/HelpFlows/GuestUserIntroRengo.tsx b/src/views/HelpFlows/GuestUserIntroRengo.tsx index 19b23acf46..d0609d867a 100644 --- a/src/views/HelpFlows/GuestUserIntroRengo.tsx +++ b/src/views/HelpFlows/GuestUserIntroRengo.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; /** * A help flow intended for guests who arrived on a Challenge Link for a Rengo game diff --git a/src/views/HelpFlows/HelpFlows.tsx b/src/views/HelpFlows/HelpFlows.tsx index 519b16e12d..b218c0cef1 100644 --- a/src/views/HelpFlows/HelpFlows.tsx +++ b/src/views/HelpFlows/HelpFlows.tsx @@ -18,7 +18,7 @@ import React from "react"; import * as DynamicHelp from "react-dynamic-help"; -import * as data from "data"; +import * as data from "@/lib/data"; import { GuestUserIntro } from "./GuestUserIntro"; import { GuestUserIntroRengo } from "./GuestUserIntroRengo"; diff --git a/src/views/HelpFlows/OJEIntro.tsx b/src/views/HelpFlows/OJEIntro.tsx index b7e5c8bfb8..6a9910aa2d 100644 --- a/src/views/HelpFlows/OJEIntro.tsx +++ b/src/views/HelpFlows/OJEIntro.tsx @@ -18,7 +18,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; export function OJEIntro(): JSX.Element { return ( diff --git a/src/views/HelpFlows/OOLSpectatorIntro.tsx b/src/views/HelpFlows/OOLSpectatorIntro.tsx index e2c285f93b..91af559d06 100644 --- a/src/views/HelpFlows/OOLSpectatorIntro.tsx +++ b/src/views/HelpFlows/OOLSpectatorIntro.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; /** * A help flow intended for spectators who arrived on an OOL Game Link diff --git a/src/views/HelpFlows/OOLUserIntro.tsx b/src/views/HelpFlows/OOLUserIntro.tsx index 723320f6e3..0e3ed3eb53 100644 --- a/src/views/HelpFlows/OOLUserIntro.tsx +++ b/src/views/HelpFlows/OOLUserIntro.tsx @@ -19,7 +19,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; /** * A help flow intended for players who arrived on an OOL Game Link diff --git a/src/views/HelpFlows/UndoIntro.tsx b/src/views/HelpFlows/UndoIntro.tsx index a8639eab9a..4bdf6a5efd 100644 --- a/src/views/HelpFlows/UndoIntro.tsx +++ b/src/views/HelpFlows/UndoIntro.tsx @@ -18,7 +18,7 @@ import React from "react"; import { HelpFlow, HelpItem } from "react-dynamic-help"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; /** * A help flow shown when you first press the undo button diff --git a/src/views/Joseki/Joseki.tsx b/src/views/Joseki/Joseki.tsx index 657022d7e1..43ac079d2b 100644 --- a/src/views/Joseki/Joseki.tsx +++ b/src/views/Joseki/Joseki.tsx @@ -22,29 +22,29 @@ import * as React from "react"; import * as ReactSelect from "react-select"; import { Link } from "react-router-dom"; -import { RouteComponentProps, rr6ClassShim } from "ogs-rr6-shims"; +import { RouteComponentProps, rr6ClassShim } from "@/lib/ogs-rr6-shims"; import * as queryString from "query-string"; -import * as data from "data"; -import { _, interpolate, pgettext, npgettext } from "translate"; -import { get, put, post } from "requests"; -import { KBShortcut } from "KBShortcut"; +import * as data from "@/lib/data"; +import { _, interpolate, pgettext, npgettext } from "@/lib/translate"; +import { get, put, post } from "@/lib/requests"; +import { KBShortcut } from "@/components/KBShortcut"; import { GobanRenderer, GobanRendererConfig, JGOFMove, createGoban } from "goban"; -import { AutoTranslate } from "AutoTranslate"; -import { Markdown } from "Markdown"; -import { chat_manager } from "chat_manager"; +import { AutoTranslate } from "@/components/AutoTranslate"; +import { Markdown } from "@/components/Markdown"; +import { chat_manager } from "@/lib/chat_manager"; -import { Player } from "Player"; +import { Player } from "@/components/Player"; -import { JosekiAdmin } from "JosekiAdmin"; +import { JosekiAdmin } from "@/components/JosekiAdmin"; -import { openModal } from "Modal"; -import { JosekiSourceModal } from "JosekiSourceModal"; -import { JosekiVariationFilter, JosekiFilter } from "JosekiVariationFilter"; -import { JosekiTagSelector, JosekiTag } from "JosekiTagSelector"; -import { Throbber } from "Throbber"; -import { IdType } from "src/lib/types"; -import { GobanContainer } from "GobanContainer"; +import { openModal } from "@/components/Modal"; +import { JosekiSourceModal } from "@/components/JosekiSourceModal"; +import { JosekiVariationFilter, JosekiFilter } from "@/components/JosekiVariationFilter"; +import { JosekiTagSelector, JosekiTag } from "@/components/JosekiTagSelector"; +import { Throbber } from "@/components/Throbber"; +import { IdType } from "@/lib/types"; +import { GobanContainer } from "@/components/GobanContainer"; const server_url = data.get("oje-url", "/oje/"); diff --git a/src/views/Ladder/Ladder.tsx b/src/views/Ladder/Ladder.tsx index 38aa1e3d88..9b4ab07803 100644 --- a/src/views/Ladder/Ladder.tsx +++ b/src/views/Ladder/Ladder.tsx @@ -16,21 +16,21 @@ */ import * as React from "react"; -import { del, get, put, post, abort_requests_in_flight } from "requests"; -import { errorAlerter } from "misc"; -import { _, pgettext, interpolate } from "translate"; -import * as data from "data"; +import { del, get, put, post, abort_requests_in_flight } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { _, pgettext, interpolate } from "@/lib/translate"; +import * as data from "@/lib/data"; import { List, AutoSizer } from "react-virtualized"; -import { Player } from "Player"; -import { UIPush } from "UIPush"; -import { shouldOpenNewTab, rulesText } from "misc"; -import { PlayerAutocomplete } from "PlayerAutocomplete"; -import { close_all_popovers, popover } from "popover"; -import { browserHistory } from "ogsHistory"; -import { alert } from "swal_config"; -import { RouteComponentProps, rr6ClassShim } from "ogs-rr6-shims"; -import { IdType } from "src/lib/types"; -import { PlayerCacheEntry } from "src/lib/player_cache"; +import { Player } from "@/components/Player"; +import { UIPush } from "@/components/UIPush"; +import { shouldOpenNewTab, rulesText } from "@/lib/misc"; +import { PlayerAutocomplete } from "@/components/PlayerAutocomplete"; +import { close_all_popovers, popover } from "@/lib/popover"; +import { browserHistory } from "@/lib/ogsHistory"; +import { alert } from "@/lib/swal_config"; +import { RouteComponentProps, rr6ClassShim } from "@/lib/ogs-rr6-shims"; +import { IdType } from "@/lib/types"; +import { PlayerCacheEntry } from "@/lib/player_cache"; type LadderProperties = RouteComponentProps<{ ladder_id: string; diff --git a/src/views/LadderList/LadderList.tsx b/src/views/LadderList/LadderList.tsx index fca0cc7514..6c7caf574c 100644 --- a/src/views/LadderList/LadderList.tsx +++ b/src/views/LadderList/LadderList.tsx @@ -16,13 +16,13 @@ */ import * as React from "react"; -import { _, interpolate } from "translate"; +import { _, interpolate } from "@/lib/translate"; import { Link } from "react-router-dom"; -import { post, get } from "requests"; -import { LadderComponent } from "LadderComponent"; -import { Card } from "material"; -import { errorAlerter } from "misc"; -import { useUser } from "hooks"; +import { post, get } from "@/lib/requests"; +import { LadderComponent } from "@/components/LadderComponent"; +import { Card } from "@/components/material"; +import { errorAlerter } from "@/lib/misc"; +import { useUser } from "@/lib/hooks"; /* Ensure these get picked up in our translations */ _("Site 19x19 Ladder"); diff --git a/src/views/LearningHub/Capture.tsx b/src/views/LearningHub/Capture.tsx index 874f4b8534..349dc94032 100644 --- a/src/views/LearningHub/Capture.tsx +++ b/src/views/LearningHub/Capture.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Capture extends LearningHubSection { diff --git a/src/views/LearningHub/Defend.tsx b/src/views/LearningHub/Defend.tsx index c9e53ce341..53eb6ec6e7 100644 --- a/src/views/LearningHub/Defend.tsx +++ b/src/views/LearningHub/Defend.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Defend extends LearningHubSection { diff --git a/src/views/LearningHub/EndingTheGame.tsx b/src/views/LearningHub/EndingTheGame.tsx index c94fc12de1..0fc6316c3f 100644 --- a/src/views/LearningHub/EndingTheGame.tsx +++ b/src/views/LearningHub/EndingTheGame.tsx @@ -18,7 +18,7 @@ import * as React from "react"; import { PuzzleConfig, GobanEngineConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class EndingTheGame extends LearningHubSection { diff --git a/src/views/LearningHub/InstructionalGoban.tsx b/src/views/LearningHub/InstructionalGoban.tsx index 1251f9b1e5..c6cff43b2b 100644 --- a/src/views/LearningHub/InstructionalGoban.tsx +++ b/src/views/LearningHub/InstructionalGoban.tsx @@ -17,8 +17,8 @@ import * as React from "react"; import { createGoban, GobanRenderer } from "goban"; -import { sfx } from "sfx"; -import { PersistentElement } from "PersistentElement"; +import { sfx } from "@/lib/sfx"; +import { PersistentElement } from "@/components/PersistentElement"; interface InstructionalGobanProps { width?: number; diff --git a/src/views/LearningHub/Intro.tsx b/src/views/LearningHub/Intro.tsx index 035098f54d..0fbff34a5b 100644 --- a/src/views/LearningHub/Intro.tsx +++ b/src/views/LearningHub/Intro.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Intro extends LearningHubSection { diff --git a/src/views/LearningHub/Ko.tsx b/src/views/LearningHub/Ko.tsx index 3ff3e35a76..c866c82d84 100644 --- a/src/views/LearningHub/Ko.tsx +++ b/src/views/LearningHub/Ko.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Ko extends LearningHubSection { diff --git a/src/views/LearningHub/Ladders.tsx b/src/views/LearningHub/Ladders.tsx index 1efe8e9ac7..b9e150b8ee 100644 --- a/src/views/LearningHub/Ladders.tsx +++ b/src/views/LearningHub/Ladders.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Ladders extends LearningHubSection { diff --git a/src/views/LearningHub/LearningHub.tsx b/src/views/LearningHub/LearningHub.tsx index 1a878205b9..14c87fddd6 100644 --- a/src/views/LearningHub/LearningHub.tsx +++ b/src/views/LearningHub/LearningHub.tsx @@ -16,16 +16,16 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import { Link, useParams } from "react-router-dom"; -import { CardLink } from "material"; -import { _, pgettext } from "translate"; +import { CardLink } from "@/components/material"; +import { _, pgettext } from "@/lib/translate"; import { sections, all_sections } from "./sections"; -import { Ribbon } from "misc-ui"; +import { Ribbon } from "@/components/misc-ui"; import { getSectionCompletion, getSectionByName } from "./util"; -import { browserHistory } from "ogsHistory"; -import { MiniGoban } from "MiniGoban"; -import { alert } from "swal_config"; +import { browserHistory } from "@/lib/ogsHistory"; +import { MiniGoban } from "@/components/MiniGoban"; +import { alert } from "@/lib/swal_config"; interface LearningHubParams { section: string; diff --git a/src/views/LearningHub/LearningPage.tsx b/src/views/LearningHub/LearningPage.tsx index 2497c1ba5a..7752f83ceb 100644 --- a/src/views/LearningHub/LearningPage.tsx +++ b/src/views/LearningHub/LearningPage.tsx @@ -18,11 +18,11 @@ import * as React from "react"; import { Link } from "react-router-dom"; import { decodeMoves, PuzzleConfig } from "goban"; -import { sfx } from "sfx"; +import { sfx } from "@/lib/sfx"; import { InstructionalGoban } from "./InstructionalGoban"; -import { browserHistory } from "ogsHistory"; +import { browserHistory } from "@/lib/ogsHistory"; import { setSectionPageCompleted, getSectionPageCompleted } from "./util"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; export interface LearningPageProperties { title: string; diff --git a/src/views/LearningHub/Seki.tsx b/src/views/LearningHub/Seki.tsx index 74783246d0..f513b293cd 100644 --- a/src/views/LearningHub/Seki.tsx +++ b/src/views/LearningHub/Seki.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class Seki extends LearningHubSection { diff --git a/src/views/LearningHub/SnapBack.tsx b/src/views/LearningHub/SnapBack.tsx index a3d49af668..173e675a19 100644 --- a/src/views/LearningHub/SnapBack.tsx +++ b/src/views/LearningHub/SnapBack.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class SnapBack extends LearningHubSection { diff --git a/src/views/LearningHub/TheBoard.tsx b/src/views/LearningHub/TheBoard.tsx index ebacab71e3..761a3eca4c 100644 --- a/src/views/LearningHub/TheBoard.tsx +++ b/src/views/LearningHub/TheBoard.tsx @@ -17,7 +17,7 @@ import { PuzzleConfig } from "goban"; import { LearningPage, LearningPageProperties } from "./LearningPage"; -import { _, pgettext } from "translate"; +import { _, pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; export class TheBoard extends LearningHubSection { diff --git a/src/views/LearningHub/sections.ts b/src/views/LearningHub/sections.ts index ebab07e287..f9e91b558b 100644 --- a/src/views/LearningHub/sections.ts +++ b/src/views/LearningHub/sections.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { pgettext } from "translate"; +import { pgettext } from "@/lib/translate"; import { LearningHubSection } from "./LearningHubSection"; import { Capture } from "./Capture"; import { Defend } from "./Defend"; diff --git a/src/views/LearningHub/util.ts b/src/views/LearningHub/util.ts index 72db68f370..927696b264 100644 --- a/src/views/LearningHub/util.ts +++ b/src/views/LearningHub/util.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import * as data from "data"; +import * as data from "@/lib/data"; import { sections, all_sections } from "./sections"; import { LearningHubSection } from "./LearningHubSection"; diff --git a/src/views/LibraryPlayer/LibraryPlayer.tsx b/src/views/LibraryPlayer/LibraryPlayer.tsx index ca0582b9b5..492adc7def 100644 --- a/src/views/LibraryPlayer/LibraryPlayer.tsx +++ b/src/views/LibraryPlayer/LibraryPlayer.tsx @@ -16,23 +16,23 @@ */ import * as React from "react"; -import * as data from "data"; -import { _, interpolate } from "translate"; +import * as data from "@/lib/data"; +import { _, interpolate } from "@/lib/translate"; import { Link } from "react-router-dom"; -import { RouteComponentProps, rr6ClassShim } from "ogs-rr6-shims"; -import { browserHistory } from "ogsHistory"; -import { abort_requests_in_flight, post, get } from "requests"; -import { errorAlerter, ignore, getOutcomeTranslation } from "misc"; -import { Player } from "Player"; -import { Card } from "material"; +import { RouteComponentProps, rr6ClassShim } from "@/lib/ogs-rr6-shims"; +import { browserHistory } from "@/lib/ogsHistory"; +import { abort_requests_in_flight, post, get } from "@/lib/requests"; +import { errorAlerter, ignore, getOutcomeTranslation } from "@/lib/misc"; +import { Player } from "@/components/Player"; +import { Card } from "@/components/material"; import Dropzone from "react-dropzone"; import { DropzoneRef } from "react-dropzone"; -import * as moment from "moment"; -import { IdType } from "src/lib/types"; -import { openSGFPasteModal } from "SGFPasteModal"; -import * as preferences from "preferences"; -import { PlayerCacheEntry } from "src/lib/player_cache"; -// import { createGameRecord } from "ChallengeModal"; +import moment from "moment"; +import { IdType } from "@/lib/types"; +import { openSGFPasteModal } from "@/components/SGFPasteModal"; +import * as preferences from "@/lib/preferences"; +import { PlayerCacheEntry } from "@/lib/player_cache"; +// import { createGameRecord } from "@/components/ChallengeModal"; type LibraryPlayerProperties = RouteComponentProps<{ player_id: string; diff --git a/src/views/Moderator/Moderator.tsx b/src/views/Moderator/Moderator.tsx index c8b2d1a48a..f672c8d6bf 100644 --- a/src/views/Moderator/Moderator.tsx +++ b/src/views/Moderator/Moderator.tsx @@ -18,15 +18,15 @@ /* spell-checker: disable */ import * as React from "react"; -import * as moment from "moment"; -import * as data from "data"; +import moment from "moment"; +import * as data from "@/lib/data"; import { Link } from "react-router-dom"; -import { _ } from "translate"; -import { PaginatedTable } from "PaginatedTable"; -import { Card } from "material"; -import { SearchInput } from "misc-ui"; -import { Player } from "Player"; -import { chat_markup } from "Chat"; +import { _ } from "@/lib/translate"; +import { PaginatedTable } from "@/components/PaginatedTable"; +import { Card } from "@/components/material"; +import { SearchInput } from "@/components/misc-ui"; +import { Player } from "@/components/Player"; +import { chat_markup } from "@/components/Chat"; import { ban, shadowban } from "./ban_functions"; const whitelist = [ diff --git a/src/views/Moderator/ban_functions.tsx b/src/views/Moderator/ban_functions.tsx index 863fe57ad6..cc32cda267 100644 --- a/src/views/Moderator/ban_functions.tsx +++ b/src/views/Moderator/ban_functions.tsx @@ -16,10 +16,10 @@ */ import * as React from "react"; -import { BanModal } from "BanModal"; -import { openModal } from "Modal"; -import { post, put } from "requests"; -import { alert } from "swal_config"; +import { BanModal } from "@/components/BanModal"; +import { openModal } from "@/components/Modal"; +import { post, put } from "@/lib/requests"; +import { alert } from "@/lib/swal_config"; function moderate(player_id: number, prompt: string, obj: any) { return new Promise((resolve, reject) => { diff --git a/src/views/ObserveGames/ObserveGames.tsx b/src/views/ObserveGames/ObserveGames.tsx index e152df2aa6..668a9b6148 100644 --- a/src/views/ObserveGames/ObserveGames.tsx +++ b/src/views/ObserveGames/ObserveGames.tsx @@ -16,7 +16,7 @@ */ import * as React from "react"; -import { ObserveGamesComponent } from "ObserveGamesComponent"; +import { ObserveGamesComponent } from "@/components/ObserveGamesComponent"; export class ObserveGames extends React.PureComponent { constructor(props: {}) { diff --git a/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.test.tsx b/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.test.tsx index 015903b945..0e00ff8d16 100644 --- a/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.test.tsx +++ b/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.test.tsx @@ -8,12 +8,12 @@ import { MemoryRouter, Route, Routes } from "react-router-dom"; import { act, render, screen, getByRole, fireEvent } from "@testing-library/react"; import "@testing-library/jest-dom"; -import * as ogs_hooks from "hooks"; +import * as ogs_hooks from "@/lib/hooks"; -import { OgsHelpProvider } from "OgsHelpProvider"; +import { OgsHelpProvider } from "@/components/OgsHelpProvider"; -import * as requests from "requests"; -import * as data from "data"; +import * as requests from "@/lib/requests"; +import * as data from "@/lib/data"; import { uiPushActions } from "../../components/UIPush/MockUIPush"; diff --git a/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.tsx b/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.tsx index e9d645efe6..2c7c19a5f7 100644 --- a/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.tsx +++ b/src/views/OnlineLeaguePlayerLanding/OnlineLeaguePlayerLanding.tsx @@ -17,20 +17,20 @@ import * as React from "react"; import { useNavigate, useLocation } from "react-router-dom"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; import * as DynamicHelp from "react-dynamic-help"; -import * as data from "data"; -import { useUser } from "hooks"; -import { _, pgettext } from "translate"; -import { get, put } from "requests"; -import { errorAlerter } from "misc"; -import { browserHistory } from "ogsHistory"; +import * as data from "@/lib/data"; +import { useUser } from "@/lib/hooks"; +import { _, pgettext } from "@/lib/translate"; +import { get, put } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; +import { browserHistory } from "@/lib/ogsHistory"; -import { LoadingPage } from "Loading"; -import { UIPush } from "UIPush"; -import { EmbeddedChatCard } from "Chat"; +import { LoadingPage } from "@/components/Loading"; +import { UIPush } from "@/components/UIPush"; +import { EmbeddedChatCard } from "@/components/Chat"; // Users are intended to arrive here via an online-league player invite URL // They need to have a valid key in that URL. The assumption is that only the diff --git a/src/views/OnlineLeagueSpectatorLanding/OnlineLeagueSpectatorLanding.tsx b/src/views/OnlineLeagueSpectatorLanding/OnlineLeagueSpectatorLanding.tsx index 4d6265987e..51b67f334e 100644 --- a/src/views/OnlineLeagueSpectatorLanding/OnlineLeagueSpectatorLanding.tsx +++ b/src/views/OnlineLeagueSpectatorLanding/OnlineLeagueSpectatorLanding.tsx @@ -17,16 +17,16 @@ import * as React from "react"; import { useNavigate, useParams } from "react-router-dom"; -import { alert } from "swal_config"; +import { alert } from "@/lib/swal_config"; -import { _, pgettext } from "translate"; -import { get } from "requests"; -import { errorAlerter } from "misc"; +import { _, pgettext } from "@/lib/translate"; +import { get } from "@/lib/requests"; +import { errorAlerter } from "@/lib/misc"; import * as DynamicHelp from "react-dynamic-help"; -import { useUser } from "hooks"; -import { LoadingPage } from "Loading"; -import { UIPush } from "UIPush"; -import { EmbeddedChatCard } from "Chat"; +import { useUser } from "@/lib/hooks"; +import { LoadingPage } from "@/components/Loading"; +import { UIPush } from "@/components/UIPush"; +import { EmbeddedChatCard } from "@/components/Chat"; // Spectators are intended to arrive here via an online-league spectate URL that provides // the Online League match ID diff --git a/src/views/Overview/ChallengesList.tsx b/src/views/Overview/ChallengesList.tsx index 8194d729e7..fb2955432a 100644 --- a/src/views/Overview/ChallengesList.tsx +++ b/src/views/Overview/ChallengesList.tsx @@ -16,18 +16,18 @@ */ import * as React from "react"; -import { _ } from "translate"; -import { Card } from "material"; -import { del, post } from "requests"; -import { browserHistory } from "ogsHistory"; -import * as data from "data"; -import { Player } from "Player"; -import { PlayerIcon } from "PlayerIcon"; -import { profanity_filter } from "profanity_filter"; -import { challenge_text_description } from "ChallengeModal"; -import { FabX, FabCheck } from "material"; -import { ignore } from "misc"; -import cached from "cached"; +import { _ } from "@/lib/translate"; +import { Card } from "@/components/material"; +import { del, post } from "@/lib/requests"; +import { browserHistory } from "@/lib/ogsHistory"; +import * as data from "@/lib/data"; +import { Player } from "@/components/Player"; +import { PlayerIcon } from "@/components/PlayerIcon"; +import { profanity_filter } from "@/lib/profanity_filter"; +import { challenge_text_description } from "@/components/ChallengeModal"; +import { FabX, FabCheck } from "@/components/material"; +import { ignore } from "@/lib/misc"; +import cached from "@/lib/cached"; interface ChallengeListProps { onAccept: () => void; diff --git a/src/views/Overview/EXV6Overview.tsx b/src/views/Overview/EXV6Overview.tsx index 919d6ebd2c..ad0d8e38e8 100644 --- a/src/views/Overview/EXV6Overview.tsx +++ b/src/views/Overview/EXV6Overview.tsx @@ -19,29 +19,29 @@ import * as React from "react"; import { Link } from "react-router-dom"; import * as DynamicHelp from "react-dynamic-help"; -import { _ } from "translate"; +import { _ } from "@/lib/translate"; -import * as data from "data"; -import * as preferences from "preferences"; -import cached from "cached"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import cached from "@/lib/cached"; -import { post, get, abort_requests_in_flight } from "requests"; +import { post, get, abort_requests_in_flight } from "@/lib/requests"; -import { errorAlerter, ignore } from "misc"; -import { DismissableNotification } from "DismissableNotification"; +import { errorAlerter, ignore } from "@/lib/misc"; +import { DismissableNotification } from "@/components/DismissableNotification"; import { ChallengesList } from "./ChallengesList"; import { InviteList } from "./InviteList"; -import { notification_manager } from "Notifications"; -import { ActiveAnnouncements } from "Announcements"; -import { ActiveTournamentList, Group } from "src/lib/types"; -import { DismissableMessages } from "DismissableMessages"; -import { EmailBanner } from "EmailBanner"; -import { ActiveDroppedGameList } from "ActiveDroppedGameList"; -import { ModerationOffer } from "ModerationOffer"; -import { NewUserRankChooser } from "NewUserRankChooser"; -import { FreeTrialBanner } from "FreeTrialBanner"; -import { SupporterProblems } from "SupporterProblems"; -import { FreeTrialSurvey } from "FreeTrialSurvey"; +import { notification_manager } from "@/components/Notifications"; +import { ActiveAnnouncements } from "@/components/Announcements"; +import { ActiveTournamentList, Group } from "@/lib/types"; +import { DismissableMessages } from "@/components/DismissableMessages"; +import { EmailBanner } from "@/components/EmailBanner"; +import { ActiveDroppedGameList } from "@/components/ActiveDroppedGameList"; +import { ModerationOffer } from "@/components/ModerationOffer"; +import { NewUserRankChooser } from "@/components/NewUserRankChooser"; +import { FreeTrialBanner } from "@/components/FreeTrialBanner"; +import { SupporterProblems } from "@/components/SupporterProblems"; +import { FreeTrialSurvey } from "@/components/FreeTrialSurvey"; declare let ogs_missing_translation_count: number; diff --git a/src/views/Overview/InviteList.tsx b/src/views/Overview/InviteList.tsx index fff0c19e55..532d6e4743 100644 --- a/src/views/Overview/InviteList.tsx +++ b/src/views/Overview/InviteList.tsx @@ -17,25 +17,25 @@ import * as React from "react"; -import * as rengo_utils from "rengo_utils"; -import * as rengo_balancer from "rengo_balancer"; -import { alert } from "swal_config"; -import { errorAlerter } from "misc"; -import { _, pgettext } from "translate"; -import { del, get } from "requests"; -import { useUser } from "hooks"; +import * as rengo_utils from "@/lib/rengo_utils"; +import * as rengo_balancer from "@/lib/rengo_balancer"; +import { alert } from "@/lib/swal_config"; +import { errorAlerter } from "@/lib/misc"; +import { _, pgettext } from "@/lib/translate"; +import { del, get } from "@/lib/requests"; +import { useUser } from "@/lib/hooks"; -import { profanity_filter } from "profanity_filter"; -import { challenge_text_description } from "ChallengeModal"; +import { profanity_filter } from "@/lib/profanity_filter"; +import { challenge_text_description } from "@/components/ChallengeModal"; -import { Card } from "material"; -import { FabX } from "material"; +import { Card } from "@/components/material"; +import { FabX } from "@/components/material"; -import { ChallengeLinkButton } from "ChallengeLinkButton"; -import { RengoManagementPane } from "RengoManagementPane"; -import { RengoTeamManagementPane } from "RengoTeamManagementPane"; -import { TimeControlTypes } from "TimeControl"; -import { RuleSet } from "types"; +import { ChallengeLinkButton } from "@/components/ChallengeLinkButton"; +import { RengoManagementPane } from "@/components/RengoManagementPane"; +import { RengoTeamManagementPane } from "@/components/RengoTeamManagementPane"; +import { TimeControlTypes } from "@/components/TimeControl"; +import { RuleSet } from "@/lib/types"; // We face two different challenge schemas because the challenge data we have is from the // 'open invites' route, which is generated by serializers.py, in the same way as the direct diff --git a/src/views/Overview/Overview.tsx b/src/views/Overview/Overview.tsx index ba05c799ec..33c432027f 100644 --- a/src/views/Overview/Overview.tsx +++ b/src/views/Overview/Overview.tsx @@ -19,33 +19,33 @@ import * as React from "react"; import { Link } from "react-router-dom"; import * as DynamicHelp from "react-dynamic-help"; -import { _ } from "translate"; -import * as data from "data"; -import * as preferences from "preferences"; -import cached from "cached"; - -import { Card } from "material"; -import { post, get, abort_requests_in_flight } from "requests"; -import { errorAlerter, ignore } from "misc"; -import { DismissableNotification } from "DismissableNotification"; -import { FriendList } from "FriendList"; +import { _ } from "@/lib/translate"; +import * as data from "@/lib/data"; +import * as preferences from "@/lib/preferences"; +import cached from "@/lib/cached"; + +import { Card } from "@/components/material"; +import { post, get, abort_requests_in_flight } from "@/lib/requests"; +import { errorAlerter, ignore } from "@/lib/misc"; +import { DismissableNotification } from "@/components/DismissableNotification"; +import { FriendList } from "@/components/FriendList"; import { ChallengesList } from "./ChallengesList"; -import { ProfileCard } from "ProfileCard"; +import { ProfileCard } from "@/components/ProfileCard"; import { InviteList } from "./InviteList"; -import { notification_manager } from "Notifications"; -import { ActiveAnnouncements } from "Announcements"; -import { FabX } from "material"; -import { ActiveTournamentList, Group } from "src/lib/types"; -import { DismissableMessages } from "DismissableMessages"; -import { Experiment, Variant, Default } from "Experiment"; +import { notification_manager } from "@/components/Notifications"; +import { ActiveAnnouncements } from "@/components/Announcements"; +import { FabX } from "@/components/material"; +import { ActiveTournamentList, Group } from "@/lib/types"; +import { DismissableMessages } from "@/components/DismissableMessages"; +import { Experiment, Variant, Default } from "@/components/Experiment"; import { EXV6Overview } from "./EXV6Overview"; -import { EmailBanner } from "EmailBanner"; -import { PaymentProblemBanner } from "PaymentProblemBanner"; -import { ActiveDroppedGameList } from "ActiveDroppedGameList"; -import { NewUserRankChooser } from "NewUserRankChooser"; -import { FreeTrialBanner } from "FreeTrialBanner"; -import { SupporterProblems } from "SupporterProblems"; -import { FreeTrialSurvey } from "FreeTrialSurvey"; +import { EmailBanner } from "@/components/EmailBanner"; +import { PaymentProblemBanner } from "@/components/PaymentProblemBanner"; +import { ActiveDroppedGameList } from "@/components/ActiveDroppedGameList"; +import { NewUserRankChooser } from "@/components/NewUserRankChooser"; +import { FreeTrialBanner } from "@/components/FreeTrialBanner"; +import { SupporterProblems } from "@/components/SupporterProblems"; +import { FreeTrialSurvey } from "@/components/FreeTrialSurvey"; declare let ogs_missing_translation_count: number; diff --git a/src/views/Play/Play.tsx b/src/views/Play/Play.tsx index b0634b22a7..043cb03f44 100644 --- a/src/views/Play/Play.tsx +++ b/src/views/Play/Play.tsx @@ -16,47 +16,47 @@ */ import * as React from "react"; -import * as data from "data"; +import * as data from "@/lib/data"; import * as DynamicHelp from "react-dynamic-help"; -import { del } from "requests"; - -import * as preferences from "preferences"; -import * as player_cache from "player_cache"; -import * as rengo_utils from "rengo_utils"; -import { OgsResizeDetector } from "OgsResizeDetector"; -import { browserHistory } from "ogsHistory"; -import { _, pgettext } from "translate"; -import { Card } from "material"; -import { SeekGraph, SeekGraphLegend } from "SeekGraph"; -import { PersistentElement } from "PersistentElement"; +import { del } from "@/lib/requests"; + +import * as preferences from "@/lib/preferences"; +import * as player_cache from "@/lib/player_cache"; +import * as rengo_utils from "@/lib/rengo_utils"; +import { OgsResizeDetector } from "@/components/OgsResizeDetector"; +import { browserHistory } from "@/lib/ogsHistory"; +import { _, pgettext } from "@/lib/translate"; +import { Card } from "@/components/material"; +import { SeekGraph, SeekGraphLegend } from "@/components/SeekGraph"; +import { PersistentElement } from "@/components/PersistentElement"; import { isLiveGame, shortShortTimeControl, timeControlSystemText, usedForCheating, -} from "TimeControl"; -import { challenge, challengeComputer } from "ChallengeModal"; -import { openGameAcceptModal } from "GameAcceptModal"; -import { errorAlerter, rulesText, dup, uuid, ignore } from "misc"; -import { Player } from "Player"; -import { openAutomatchSettings, getAutomatchSettings } from "AutomatchSettings"; -import { automatch_manager, AutomatchPreferences } from "automatch_manager"; -import { bot_count } from "bots"; -import { CreatedChallengeInfo } from "types"; -import { ChallengeLinkButton } from "ChallengeLinkButton"; +} from "@/components/TimeControl"; +import { challenge, challengeComputer } from "@/components/ChallengeModal"; +import { openGameAcceptModal } from "@/components/GameAcceptModal"; +import { errorAlerter, rulesText, dup, uuid, ignore } from "@/lib/misc"; +import { Player } from "@/components/Player"; +import { openAutomatchSettings, getAutomatchSettings } from "@/components/AutomatchSettings"; +import { automatch_manager, AutomatchPreferences } from "@/lib/automatch_manager"; +import { bot_count } from "@/lib/bots"; +import { CreatedChallengeInfo } from "@/lib/types"; +import { ChallengeLinkButton } from "@/components/ChallengeLinkButton"; import { allocateCanvasOrError } from "goban"; -import { alert } from "swal_config"; -import { Size } from "src/lib/types"; +import { alert } from "@/lib/swal_config"; +import { Size } from "@/lib/types"; -import { RengoManagementPane } from "RengoManagementPane"; -import { RengoTeamManagementPane } from "RengoTeamManagementPane"; +import { RengoManagementPane } from "@/components/RengoManagementPane"; +import { RengoTeamManagementPane } from "@/components/RengoTeamManagementPane"; import { Challenge, ChallengeFilter, ChallengeFilterKey, shouldDisplayChallenge, -} from "challenge_utils"; +} from "@/lib/challenge_utils"; const CHALLENGE_LIST_FREEZE_PERIOD = 1000; // Freeze challenge list for this period while they move their mouse on it @@ -225,7 +225,7 @@ export class Play extends React.Component<{}, PlayState> { C.handicap_text = C.handicap; } - //console.log(C); + console.log(C); if (C.komi === null) { C.komi_text = _("Auto"); @@ -763,7 +763,7 @@ export class Play extends React.Component<{}, PlayState> { return (
-
{_("Automatch finder")}
+
{_("Automatch Finder")}