diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..9bdb560085 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + extends: ['react-app', 'plugin:@typescript-eslint/recommended'], + plugins: ['no-relative-import-paths', 'simple-import-sort'], + rules: { + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/camelcase': 'off', + '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/ban-ts-comment': 'warn', + '@typescript-eslint/ban-types': 'off', + 'no-relative-import-paths/no-relative-import-paths': ['error', { allowSameFolder: true }], + 'simple-import-sort/imports': 'error' + }, + overrides: [ + { + files: ['*.ts', '*.tsx', '*.js', '*.jsx'].map(filename => `**/__tests__/**/${filename}`), + rules: { + 'no-relative-import-paths/no-relative-import-paths': 'off' + } + } + ] +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 8c2331ab88..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": ["react-app", "plugin:@typescript-eslint/recommended"], - "plugins": ["simple-import-sort"], - "rules": { - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/ban-ts-comment": "warn", - "@typescript-eslint/ban-types": "off", - "simple-import-sort/imports": "error" - } -} diff --git a/package.json b/package.json index 8d443213af..6bccc5374c 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "constants-browserify": "^1.0.0", "coveralls": "^3.1.1", "cross-env": "^7.0.3", + "eslint-plugin-no-relative-import-paths": "^1.5.2", "eslint-plugin-simple-import-sort": "^7.0.0", "https-browserify": "^1.0.0", "husky": "^8.0.2", diff --git a/src/commons/XMLParser/XMLParserHelper.ts b/src/commons/XMLParser/XMLParserHelper.ts index fbf9385575..e3ad58fc77 100644 --- a/src/commons/XMLParser/XMLParserHelper.ts +++ b/src/commons/XMLParser/XMLParserHelper.ts @@ -1,7 +1,5 @@ import { Chapter } from 'js-slang/dist/types'; -import { Builder } from 'xml2js'; - -import { ExternalLibraryName } from '../application/types/ExternalTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { Assessment, AssessmentOverview, @@ -17,7 +15,9 @@ import { Question, Testcase, TestcaseTypes -} from '../assessment/AssessmentTypes'; +} from 'src/commons/assessment/AssessmentTypes'; +import { Builder } from 'xml2js'; + import { EDITING_ID, XmlParseStrCProblem, diff --git a/src/commons/XMLParser/XMLParserTypes.ts b/src/commons/XMLParser/XMLParserTypes.ts index f951775ac0..57a088afe5 100644 --- a/src/commons/XMLParser/XMLParserTypes.ts +++ b/src/commons/XMLParser/XMLParserTypes.ts @@ -1,5 +1,5 @@ -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { Question } from '../assessment/AssessmentTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { Question } from 'src/commons/assessment/AssessmentTypes'; export const EDITING_ID = -1; diff --git a/src/commons/achievement/AchievementCard.tsx b/src/commons/achievement/AchievementCard.tsx index bf68d6adec..ac04e4bb29 100644 --- a/src/commons/achievement/AchievementCard.tsx +++ b/src/commons/achievement/AchievementCard.tsx @@ -2,8 +2,8 @@ import { Icon, Intent, ProgressBar } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React, { useContext } from 'react'; import { AchievementContext, handleGlow } from 'src/features/achievement/AchievementConstants'; +import { AchievementStatus } from 'src/features/achievement/AchievementTypes'; -import { AchievementStatus } from '../../features/achievement/AchievementTypes'; import AchievementDeadline from './card/AchievementDeadline'; import AchievementXp from './card/AchievementXp'; diff --git a/src/commons/achievement/AchievementCommentCard.tsx b/src/commons/achievement/AchievementCommentCard.tsx index fe8cc768d4..a5b9a80a96 100644 --- a/src/commons/achievement/AchievementCommentCard.tsx +++ b/src/commons/achievement/AchievementCommentCard.tsx @@ -1,10 +1,9 @@ import React, { useMemo } from 'react'; import { useNavigate } from 'react-router'; - -import { Assessment } from '../assessment/AssessmentTypes'; -import { useTypedSelector } from '../utils/Hooks'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { assessmentTypeLink } from '../utils/ParamParseHelper'; +import { Assessment } from 'src/commons/assessment/AssessmentTypes'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; const AchievementCommentCard: React.FC<{ assessment: Assessment; diff --git a/src/commons/achievement/AchievementFilter.tsx b/src/commons/achievement/AchievementFilter.tsx index d63dabcc95..eb6c9c2338 100644 --- a/src/commons/achievement/AchievementFilter.tsx +++ b/src/commons/achievement/AchievementFilter.tsx @@ -1,8 +1,7 @@ import { Icon, IconName } from '@blueprintjs/core'; import React from 'react'; - -import { getFilterColor } from '../../features/achievement/AchievementConstants'; -import { FilterStatus } from '../../features/achievement/AchievementTypes'; +import { getFilterColor } from 'src/features/achievement/AchievementConstants'; +import { FilterStatus } from 'src/features/achievement/AchievementTypes'; type AchievementFilterProps = { filterState: [FilterStatus, any]; diff --git a/src/commons/achievement/AchievementManualEditor.tsx b/src/commons/achievement/AchievementManualEditor.tsx index 859eee93bb..4412029b5a 100644 --- a/src/commons/achievement/AchievementManualEditor.tsx +++ b/src/commons/achievement/AchievementManualEditor.tsx @@ -1,6 +1,10 @@ import { Button, Checkbox, MenuItem, NumericInput } from '@blueprintjs/core'; import { ItemPredicate, ItemRenderer, Select } from '@blueprintjs/select'; import React, { useContext, useEffect, useState } from 'react'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import { AchievementGoal, @@ -8,8 +12,6 @@ import { GoalProgress } from 'src/features/achievement/AchievementTypes'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; - type AchievementManualEditorProps = { hiddenState: [boolean, any]; userState: [AchievementUser | undefined, any]; diff --git a/src/commons/achievement/AchievementOverview.tsx b/src/commons/achievement/AchievementOverview.tsx index f535043ef5..4c94cfda71 100644 --- a/src/commons/achievement/AchievementOverview.tsx +++ b/src/commons/achievement/AchievementOverview.tsx @@ -1,9 +1,9 @@ import React, { useEffect } from 'react'; import { useDispatch } from 'react-redux'; +import { FETCH_TOTAL_XP, FETCH_TOTAL_XP_ADMIN } from 'src/commons/application/types/SessionTypes'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; import { AchievementUser } from 'src/features/achievement/AchievementTypes'; -import { FETCH_TOTAL_XP, FETCH_TOTAL_XP_ADMIN } from '../application/types/SessionTypes'; -import { useTypedSelector } from '../utils/Hooks'; import AchievementLevel from './overview/AchievementLevel'; type AchievementOverviewProps = { diff --git a/src/commons/achievement/AchievementTask.tsx b/src/commons/achievement/AchievementTask.tsx index ef339823ce..5488e07bd6 100644 --- a/src/commons/achievement/AchievementTask.tsx +++ b/src/commons/achievement/AchievementTask.tsx @@ -1,11 +1,8 @@ import { Collapse } from '@blueprintjs/core'; import React, { useContext, useState } from 'react'; +import { AchievementContext, getAbilityColor } from 'src/features/achievement/AchievementConstants'; +import { AchievementStatus, FilterStatus } from 'src/features/achievement/AchievementTypes'; -import { - AchievementContext, - getAbilityColor -} from '../../features/achievement/AchievementConstants'; -import { AchievementStatus, FilterStatus } from '../../features/achievement/AchievementTypes'; import AchievementCard from './AchievementCard'; type AchievementTaskProps = { diff --git a/src/commons/achievement/AchievementView.tsx b/src/commons/achievement/AchievementView.tsx index 43dc219776..2f40320051 100644 --- a/src/commons/achievement/AchievementView.tsx +++ b/src/commons/achievement/AchievementView.tsx @@ -2,16 +2,19 @@ import { Icon } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React, { useContext, useEffect } from 'react'; import { useDispatch } from 'react-redux'; - +import { + FETCH_ASSESSMENT, + FETCH_ASSESSMENT_ADMIN +} from 'src/commons/application/types/SessionTypes'; +import { Assessment, FETCH_ASSESSMENT_OVERVIEWS } from 'src/commons/assessment/AssessmentTypes'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; import { AchievementContext, getAbilityBackground, getAbilityGlow -} from '../../features/achievement/AchievementConstants'; -import { AchievementStatus, AchievementUser } from '../../features/achievement/AchievementTypes'; -import { FETCH_ASSESSMENT, FETCH_ASSESSMENT_ADMIN } from '../application/types/SessionTypes'; -import { Assessment, FETCH_ASSESSMENT_OVERVIEWS } from '../assessment/AssessmentTypes'; -import { useTypedSelector } from '../utils/Hooks'; +} from 'src/features/achievement/AchievementConstants'; +import { AchievementStatus, AchievementUser } from 'src/features/achievement/AchievementTypes'; + import AchievementCommentCard from './AchievementCommentCard'; import { prettifyDate } from './utils/DateHelper'; import AchievementViewCompletion from './view/AchievementViewCompletion'; diff --git a/src/commons/achievement/card/AchievementDeadline.tsx b/src/commons/achievement/card/AchievementDeadline.tsx index d1f313bb03..0e274f25fb 100644 --- a/src/commons/achievement/card/AchievementDeadline.tsx +++ b/src/commons/achievement/card/AchievementDeadline.tsx @@ -1,9 +1,12 @@ import { Icon } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import { DeadlineColors } from '../../../features/achievement/AchievementConstants'; -import { isExpired, prettifyDeadline, timeFromExpired } from '../utils/DateHelper'; +import { + isExpired, + prettifyDeadline, + timeFromExpired +} from 'src/commons/achievement/utils/DateHelper'; +import { DeadlineColors } from 'src/features/achievement/AchievementConstants'; type AchievementDeadlineProps = { deadline?: Date; diff --git a/src/commons/achievement/control/AchievementPreview.tsx b/src/commons/achievement/control/AchievementPreview.tsx index 62e5ca019b..e0e5a7958b 100644 --- a/src/commons/achievement/control/AchievementPreview.tsx +++ b/src/commons/achievement/control/AchievementPreview.tsx @@ -1,12 +1,11 @@ import { Button } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React, { useContext, useReducer, useState } from 'react'; +import AchievementView from 'src/commons/achievement/AchievementView'; import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import { FilterStatus } from 'src/features/achievement/AchievementTypes'; import { generateAchievementTasks } from 'src/pages/achievement/subcomponents/AchievementDashboard'; -import AchievementView from '../AchievementView'; - type AchievementPreviewProps = { awaitPublish: boolean; publishChanges: () => void; diff --git a/src/commons/achievement/control/achievementEditor/AchievementTemplate.ts b/src/commons/achievement/control/achievementEditor/AchievementTemplate.ts index 26a148ad4d..db1a9df4c6 100644 --- a/src/commons/achievement/control/achievementEditor/AchievementTemplate.ts +++ b/src/commons/achievement/control/achievementEditor/AchievementTemplate.ts @@ -1,11 +1,5 @@ -import { - cardBackgroundUrl, - coverImageUrl -} from '../../../../features/achievement/AchievementConstants'; -import { - AchievementItem, - AchievementView -} from '../../../../features/achievement/AchievementTypes'; +import { cardBackgroundUrl, coverImageUrl } from 'src/features/achievement/AchievementConstants'; +import { AchievementItem, AchievementView } from 'src/features/achievement/AchievementTypes'; export const viewTemplate: AchievementView = { coverImage: `${coverImageUrl}/default.png`, diff --git a/src/commons/achievement/control/achievementEditor/EditableCard.tsx b/src/commons/achievement/control/achievementEditor/EditableCard.tsx index 17ceace87e..cde04e00f8 100644 --- a/src/commons/achievement/control/achievementEditor/EditableCard.tsx +++ b/src/commons/achievement/control/achievementEditor/EditableCard.tsx @@ -3,14 +3,11 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import { cloneDeep } from 'lodash'; import React, { useContext, useMemo, useReducer, useState } from 'react'; +import ItemDeleter from 'src/commons/achievement/control/common/ItemDeleter'; +import ItemSaver from 'src/commons/achievement/control/common/ItemSaver'; +import { AchievementContext } from 'src/features/achievement/AchievementConstants'; +import { AchievementItem, AchievementView } from 'src/features/achievement/AchievementTypes'; -import { AchievementContext } from '../../../../features/achievement/AchievementConstants'; -import { - AchievementItem, - AchievementView -} from '../../../../features/achievement/AchievementTypes'; -import ItemDeleter from '../common/ItemDeleter'; -import ItemSaver from '../common/ItemSaver'; import AchievementSettings from './AchievementSettings'; import AchievementUuidCopier from './AchievementUuidCopier'; import { diff --git a/src/commons/achievement/control/goalEditor/EditableGoal.tsx b/src/commons/achievement/control/goalEditor/EditableGoal.tsx index f3bf9d4eb5..8f4b874eaa 100644 --- a/src/commons/achievement/control/goalEditor/EditableGoal.tsx +++ b/src/commons/achievement/control/goalEditor/EditableGoal.tsx @@ -1,11 +1,11 @@ import { EditableText } from '@blueprintjs/core'; import { cloneDeep } from 'lodash'; import React, { useContext, useMemo, useReducer, useState } from 'react'; +import ItemDeleter from 'src/commons/achievement/control/common/ItemDeleter'; +import ItemSaver from 'src/commons/achievement/control/common/ItemSaver'; import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import { GoalDefinition, GoalMeta } from 'src/features/achievement/AchievementTypes'; -import ItemDeleter from '../common/ItemDeleter'; -import ItemSaver from '../common/ItemSaver'; import { EditableGoalAction as Action, EditableGoalActionType as ActionType, diff --git a/src/commons/achievement/control/goalEditor/metaDetails/EditableEventMeta.tsx b/src/commons/achievement/control/goalEditor/metaDetails/EditableEventMeta.tsx index b2ea3beb5d..a63f84b85b 100644 --- a/src/commons/achievement/control/goalEditor/metaDetails/EditableEventMeta.tsx +++ b/src/commons/achievement/control/goalEditor/metaDetails/EditableEventMeta.tsx @@ -3,11 +3,10 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import { ItemRenderer, Select } from '@blueprintjs/select'; import React from 'react'; +import EditableDate from 'src/commons/achievement/control/goalEditor/EditableDate'; +import EditableTime from 'src/commons/achievement/control/goalEditor/EditableTime'; import { EventMeta, EventType, GoalMeta } from 'src/features/achievement/AchievementTypes'; -import EditableDate from '../EditableDate'; -import EditableTime from '../EditableTime'; - type EditableEventMetaProps = { changeMeta: (meta: GoalMeta) => void; eventMeta: EventMeta; diff --git a/src/commons/achievement/overview/AchievementLevel.tsx b/src/commons/achievement/overview/AchievementLevel.tsx index d8cf6985c2..9fa510f0d1 100644 --- a/src/commons/achievement/overview/AchievementLevel.tsx +++ b/src/commons/achievement/overview/AchievementLevel.tsx @@ -1,8 +1,8 @@ import { ProgressBar } from '@blueprintjs/core'; import React, { useState } from 'react'; +import Constants from 'src/commons/utils/Constants'; +import { xpPerLevel } from 'src/features/achievement/AchievementConstants'; -import { xpPerLevel } from '../../../features/achievement/AchievementConstants'; -import Constants from '../../utils/Constants'; import AchievementMilestone from './AchievementMilestone'; type AchievementLevelProps = { diff --git a/src/commons/achievement/overview/AchievementMilestone.tsx b/src/commons/achievement/overview/AchievementMilestone.tsx index 78224168ec..1b2d321577 100644 --- a/src/commons/achievement/overview/AchievementMilestone.tsx +++ b/src/commons/achievement/overview/AchievementMilestone.tsx @@ -1,6 +1,5 @@ import React from 'react'; - -import Constants from '../../utils/Constants'; +import Constants from 'src/commons/utils/Constants'; type AchievementMilestoneProps = { studentXp: number; diff --git a/src/commons/achievement/utils/AchievementBackender.ts b/src/commons/achievement/utils/AchievementBackender.ts index fed0709779..0b2d5b9749 100644 --- a/src/commons/achievement/utils/AchievementBackender.ts +++ b/src/commons/achievement/utils/AchievementBackender.ts @@ -4,7 +4,7 @@ import { GoalDefinition, GoalMeta, GoalType -} from '../../../features/achievement/AchievementTypes'; +} from 'src/features/achievement/AchievementTypes'; export const backendifyGoalDefinition = (goal: GoalDefinition) => ({ targetCount: goal.meta.type === GoalType.ASSESSMENT ? 1 : goal.meta.targetCount, diff --git a/src/commons/achievement/utils/AchievementInferencer.ts b/src/commons/achievement/utils/AchievementInferencer.ts index f83478ac7d..522cdb0fce 100644 --- a/src/commons/achievement/utils/AchievementInferencer.ts +++ b/src/commons/achievement/utils/AchievementInferencer.ts @@ -1,6 +1,5 @@ import { cloneDeep, uniq } from 'lodash'; -import { v4 } from 'uuid'; - +import { showDangerMessage } from 'src/commons/utils/notifications/NotificationsHelper'; import { AchievementGoal, AchievementItem, @@ -9,8 +8,9 @@ import { GoalDefinition, GoalProgress, GoalType -} from '../../../features/achievement/AchievementTypes'; -import { showDangerMessage } from '../../utils/notifications/NotificationsHelper'; +} from 'src/features/achievement/AchievementTypes'; +import { v4 } from 'uuid'; + import { isExpired, isReleased } from './DateHelper'; /** diff --git a/src/commons/achievement/utils/EventHandler.ts b/src/commons/achievement/utils/EventHandler.ts index b2673650f1..4d0d159e94 100644 --- a/src/commons/achievement/utils/EventHandler.ts +++ b/src/commons/achievement/utils/EventHandler.ts @@ -1,3 +1,4 @@ +import { showSuccessMessage } from 'src/commons/utils/notifications/NotificationsHelper'; import { AchievementGoal, AchievementItem, @@ -5,8 +6,8 @@ import { EventType, GoalProgress, GoalType -} from '../../../features/achievement/AchievementTypes'; -import { showSuccessMessage } from '../../utils/notifications/NotificationsHelper'; +} from 'src/features/achievement/AchievementTypes'; + import AchievementInferencer from './AchievementInferencer'; import { isExpired, isReleased, isWithinTimeRange } from './DateHelper'; diff --git a/src/commons/achievement/utils/InsertFakeAchievements.ts b/src/commons/achievement/utils/InsertFakeAchievements.ts index 81dbef4901..2eb8f6a312 100644 --- a/src/commons/achievement/utils/InsertFakeAchievements.ts +++ b/src/commons/achievement/utils/InsertFakeAchievements.ts @@ -1,11 +1,11 @@ import moment from 'moment'; - import { - cardBackgroundUrl, - coverImageUrl -} from '../../../features/achievement/AchievementConstants'; -import { GoalType } from '../../../features/achievement/AchievementTypes'; -import { AssessmentConfiguration, AssessmentOverview } from '../../assessment/AssessmentTypes'; + AssessmentConfiguration, + AssessmentOverview +} from 'src/commons/assessment/AssessmentTypes'; +import { cardBackgroundUrl, coverImageUrl } from 'src/features/achievement/AchievementConstants'; +import { GoalType } from 'src/features/achievement/AchievementTypes'; + import AchievementInferencer from './AchievementInferencer'; import { isExpired, isReleased } from './DateHelper'; diff --git a/src/commons/achievement/view/AchievementViewGoal.tsx b/src/commons/achievement/view/AchievementViewGoal.tsx index 08dbd9ed15..7f90b707b6 100644 --- a/src/commons/achievement/view/AchievementViewGoal.tsx +++ b/src/commons/achievement/view/AchievementViewGoal.tsx @@ -1,7 +1,6 @@ import { ProgressBar } from '@blueprintjs/core'; import React from 'react'; - -import { AchievementGoal } from '../../../features/achievement/AchievementTypes'; +import { AchievementGoal } from 'src/features/achievement/AchievementTypes'; type AchievementViewGoalProps = { goals: AchievementGoal[]; diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index d7807a8276..7b991041cb 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -1,11 +1,14 @@ import * as React from 'react'; import { useDispatch } from 'react-redux'; import { Outlet } from 'react-router-dom'; +import NavigationBar from 'src/commons/navigationBar/NavigationBar'; +import Constants from 'src/commons/utils/Constants'; +import { useLocalStorageState, useSession } from 'src/commons/utils/Hooks'; +import { + defaultWorkspaceSettings, + WorkspaceSettingsContext +} from 'src/commons/WorkspaceSettingsContext'; -import NavigationBar from '../navigationBar/NavigationBar'; -import Constants from '../utils/Constants'; -import { useLocalStorageState, useSession } from '../utils/Hooks'; -import { defaultWorkspaceSettings, WorkspaceSettingsContext } from '../WorkspaceSettingsContext'; import { fetchUserAndCourse } from './actions/SessionActions'; const Application: React.FC = () => { diff --git a/src/commons/application/ApplicationTypes.ts b/src/commons/application/ApplicationTypes.ts index 1817a8384f..e8f6e0285f 100644 --- a/src/commons/application/ApplicationTypes.ts +++ b/src/commons/application/ApplicationTypes.ts @@ -1,23 +1,23 @@ import { Chapter, Language, SourceError, Variant } from 'js-slang/dist/types'; - -import { AcademyState } from '../../features/academy/AcademyTypes'; -import { AchievementState } from '../../features/achievement/AchievementTypes'; -import { DashboardState } from '../../features/dashboard/DashboardTypes'; -import { Grading } from '../../features/grading/GradingTypes'; -import { PlaygroundState } from '../../features/playground/PlaygroundTypes'; -import { PlaybackStatus, RecordingStatus } from '../../features/sourceRecorder/SourceRecorderTypes'; -import { StoriesEnvState, StoriesState } from '../../features/stories/StoriesTypes'; -import { WORKSPACE_BASE_PATHS } from '../../pages/fileSystem/createInBrowserFileSystem'; -import { Assessment } from '../assessment/AssessmentTypes'; -import { FileSystemState } from '../fileSystem/FileSystemTypes'; -import Constants from '../utils/Constants'; -import { createContext } from '../utils/JsSlangHelper'; +import { Assessment } from 'src/commons/assessment/AssessmentTypes'; +import { FileSystemState } from 'src/commons/fileSystem/FileSystemTypes'; +import Constants from 'src/commons/utils/Constants'; +import { createContext } from 'src/commons/utils/JsSlangHelper'; import { DebuggerContext, WorkspaceLocation, WorkspaceManagerState, WorkspaceState -} from '../workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceTypes'; +import { AcademyState } from 'src/features/academy/AcademyTypes'; +import { AchievementState } from 'src/features/achievement/AchievementTypes'; +import { DashboardState } from 'src/features/dashboard/DashboardTypes'; +import { Grading } from 'src/features/grading/GradingTypes'; +import { PlaygroundState } from 'src/features/playground/PlaygroundTypes'; +import { PlaybackStatus, RecordingStatus } from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { StoriesEnvState, StoriesState } from 'src/features/stories/StoriesTypes'; +import { WORKSPACE_BASE_PATHS } from 'src/pages/fileSystem/createInBrowserFileSystem'; + import { RouterState } from './types/CommonsTypes'; import { ExternalLibraryName } from './types/ExternalTypes'; import { SessionState } from './types/SessionTypes'; diff --git a/src/commons/application/ApplicationWrapper.tsx b/src/commons/application/ApplicationWrapper.tsx index 5f023eab55..6e1a6abcc7 100644 --- a/src/commons/application/ApplicationWrapper.tsx +++ b/src/commons/application/ApplicationWrapper.tsx @@ -2,10 +2,10 @@ import { useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { RouterProvider } from 'react-router'; import { createBrowserRouter } from 'react-router-dom'; +import Constants from 'src/commons/utils/Constants'; +import { useSession } from 'src/commons/utils/Hooks'; +import { getFullAcademyRouterConfig, playgroundOnlyRouterConfig } from 'src/routes/routerConfig'; -import { getFullAcademyRouterConfig, playgroundOnlyRouterConfig } from '../../routes/routerConfig'; -import Constants from '../utils/Constants'; -import { useSession } from '../utils/Hooks'; import { updateReactRouter } from './actions/CommonsActions'; /** diff --git a/src/commons/application/actions/CommonsActions.ts b/src/commons/application/actions/CommonsActions.ts index 73392ab997..35b14b4d86 100644 --- a/src/commons/application/actions/CommonsActions.ts +++ b/src/commons/application/actions/CommonsActions.ts @@ -1,8 +1,7 @@ import { Router } from '@remix-run/router'; +import { LOG_OUT, UPDATE_REACT_ROUTER } from 'src/commons/application/types/CommonsTypes'; import { action } from 'typesafe-actions'; // EDITED -import { LOG_OUT, UPDATE_REACT_ROUTER } from '../types/CommonsTypes'; - export const logOut = () => action(LOG_OUT); export const updateReactRouter = (updatedRouter: Router) => action(UPDATE_REACT_ROUTER, updatedRouter); diff --git a/src/commons/application/actions/InterpreterActions.ts b/src/commons/application/actions/InterpreterActions.ts index 95c48356ef..33878e0d9d 100644 --- a/src/commons/application/actions/InterpreterActions.ts +++ b/src/commons/application/actions/InterpreterActions.ts @@ -1,7 +1,4 @@ import { SourceError, Value } from 'js-slang/dist/types'; -import { action } from 'typesafe-actions'; - -import { WorkspaceLocation } from '../../workspace/WorkspaceTypes'; import { BEGIN_DEBUG_PAUSE, BEGIN_INTERRUPT_EXECUTION, @@ -14,7 +11,9 @@ import { EVAL_TESTCASE_FAILURE, EVAL_TESTCASE_SUCCESS, HANDLE_CONSOLE_LOG -} from '../types/InterpreterTypes'; +} from 'src/commons/application/types/InterpreterTypes'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { action } from 'typesafe-actions'; export const handleConsoleLog = (workspaceLocation: WorkspaceLocation, ...logString: string[]) => action(HANDLE_CONSOLE_LOG, { logString, workspaceLocation }); diff --git a/src/commons/application/actions/SessionActions.ts b/src/commons/application/actions/SessionActions.ts index 3f86c93269..f4f3060167 100644 --- a/src/commons/application/actions/SessionActions.ts +++ b/src/commons/application/actions/SessionActions.ts @@ -1,19 +1,4 @@ -import { action } from 'typesafe-actions'; // EDITED - -import { Grading, GradingOverview } from '../../../features/grading/GradingTypes'; -import { - Assessment, - AssessmentConfiguration, - AssessmentOverview, - ContestEntry -} from '../../assessment/AssessmentTypes'; -import { MissionRepoData } from '../../githubAssessments/GitHubMissionTypes'; -import { - Notification, - NotificationFilterFunction -} from '../../notificationBadge/NotificationBadgeTypes'; -import { generateOctokitInstance } from '../../utils/GitHubPersistenceHelper'; -import { Role } from '../ApplicationTypes'; +import { Role } from 'src/commons/application/ApplicationTypes'; import { ACKNOWLEDGE_NOTIFICATIONS, AdminPanelCourseRegistration, @@ -82,7 +67,21 @@ import { UPDATE_USER_ROLE, UpdateCourseConfiguration, User -} from '../types/SessionTypes'; +} from 'src/commons/application/types/SessionTypes'; +import { + Assessment, + AssessmentConfiguration, + AssessmentOverview, + ContestEntry +} from 'src/commons/assessment/AssessmentTypes'; +import { MissionRepoData } from 'src/commons/githubAssessments/GitHubMissionTypes'; +import { + Notification, + NotificationFilterFunction +} from 'src/commons/notificationBadge/NotificationBadgeTypes'; +import { generateOctokitInstance } from 'src/commons/utils/GitHubPersistenceHelper'; +import { Grading, GradingOverview } from 'src/features/grading/GradingTypes'; +import { action } from 'typesafe-actions'; // EDITED export const fetchAuth = (code: string, providerId?: string) => action(FETCH_AUTH, { code, providerId }); diff --git a/src/commons/application/reducers/CommonsReducer.ts b/src/commons/application/reducers/CommonsReducer.ts index e992c747dd..349c1548c8 100644 --- a/src/commons/application/reducers/CommonsReducer.ts +++ b/src/commons/application/reducers/CommonsReducer.ts @@ -1,9 +1,8 @@ import { Reducer } from 'redux'; +import { defaultRouter } from 'src/commons/application/ApplicationTypes'; +import { RouterState, UPDATE_REACT_ROUTER } from 'src/commons/application/types/CommonsTypes'; import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultRouter } from '../ApplicationTypes'; -import { RouterState, UPDATE_REACT_ROUTER } from '../types/CommonsTypes'; - export const RouterReducer: Reducer = ( state = defaultRouter, action: SourceActionType diff --git a/src/commons/application/reducers/RootReducer.ts b/src/commons/application/reducers/RootReducer.ts index 88c1083947..9bd405cbc0 100644 --- a/src/commons/application/reducers/RootReducer.ts +++ b/src/commons/application/reducers/RootReducer.ts @@ -1,13 +1,13 @@ import { combineReducers } from 'redux'; +import { ApplicationReducer as application } from 'src/commons/application/ApplicationReducer'; +import { FileSystemReducer as fileSystem } from 'src/commons/fileSystem/FileSystemReducer'; +import { WorkspaceReducer as workspaces } from 'src/commons/workspace/WorkspaceReducer'; +import { AcademyReducer as academy } from 'src/features/academy/AcademyReducer'; +import { AchievementReducer as achievement } from 'src/features/achievement/AchievementReducer'; +import { DashboardReducer as dashboard } from 'src/features/dashboard/DashboardReducer'; +import { PlaygroundReducer as playground } from 'src/features/playground/PlaygroundReducer'; +import { StoriesReducer as stories } from 'src/features/stories/StoriesReducer'; -import { AcademyReducer as academy } from '../../../features/academy/AcademyReducer'; -import { AchievementReducer as achievement } from '../../../features/achievement/AchievementReducer'; -import { DashboardReducer as dashboard } from '../../../features/dashboard/DashboardReducer'; -import { PlaygroundReducer as playground } from '../../../features/playground/PlaygroundReducer'; -import { StoriesReducer as stories } from '../../../features/stories/StoriesReducer'; -import { FileSystemReducer as fileSystem } from '../../fileSystem/FileSystemReducer'; -import { WorkspaceReducer as workspaces } from '../../workspace/WorkspaceReducer'; -import { ApplicationReducer as application } from '../ApplicationReducer'; import { RouterReducer as router } from './CommonsReducer'; import { SessionsReducer as session } from './SessionsReducer'; diff --git a/src/commons/application/reducers/SessionsReducer.ts b/src/commons/application/reducers/SessionsReducer.ts index 32491eadd6..bf0b984128 100644 --- a/src/commons/application/reducers/SessionsReducer.ts +++ b/src/commons/application/reducers/SessionsReducer.ts @@ -1,12 +1,6 @@ import { Reducer } from 'redux'; - -import { - REMOTE_EXEC_UPDATE_DEVICES, - REMOTE_EXEC_UPDATE_SESSION -} from '../../../features/remoteExecution/RemoteExecutionTypes'; -import { SourceActionType } from '../../utils/ActionsHelper'; -import { defaultSession } from '../ApplicationTypes'; -import { LOG_OUT } from '../types/CommonsTypes'; +import { defaultSession } from 'src/commons/application/ApplicationTypes'; +import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; import { REMOVE_GITHUB_OCTOKIT_OBJECT_AND_ACCESS_TOKEN, SessionState, @@ -29,7 +23,12 @@ import { UPDATE_GRADING_OVERVIEWS, UPDATE_NOTIFICATIONS, UPDATE_TOTAL_XP -} from '../types/SessionTypes'; +} from 'src/commons/application/types/SessionTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; +import { + REMOTE_EXEC_UPDATE_DEVICES, + REMOTE_EXEC_UPDATE_SESSION +} from 'src/features/remoteExecution/RemoteExecutionTypes'; export const SessionsReducer: Reducer = ( state = defaultSession, diff --git a/src/commons/application/types/SessionTypes.ts b/src/commons/application/types/SessionTypes.ts index f1b5d12681..ebd5f834ea 100644 --- a/src/commons/application/types/SessionTypes.ts +++ b/src/commons/application/types/SessionTypes.ts @@ -1,16 +1,15 @@ import { Octokit } from '@octokit/rest'; import { Chapter, Variant } from 'js-slang/dist/types'; - -import { Grading, GradingOverview } from '../../../features/grading/GradingTypes'; -import { Device, DeviceSession } from '../../../features/remoteExecution/RemoteExecutionTypes'; +import { GameState, Role, Story } from 'src/commons/application/ApplicationTypes'; import { Assessment, AssessmentConfiguration, AssessmentOverview -} from '../../assessment/AssessmentTypes'; -import { MissionRepoData } from '../../githubAssessments/GitHubMissionTypes'; -import { Notification } from '../../notificationBadge/NotificationBadgeTypes'; -import { GameState, Role, Story } from '../ApplicationTypes'; +} from 'src/commons/assessment/AssessmentTypes'; +import { MissionRepoData } from 'src/commons/githubAssessments/GitHubMissionTypes'; +import { Notification } from 'src/commons/notificationBadge/NotificationBadgeTypes'; +import { Grading, GradingOverview } from 'src/features/grading/GradingTypes'; +import { Device, DeviceSession } from 'src/features/remoteExecution/RemoteExecutionTypes'; export const FETCH_AUTH = 'FETCH_AUTH'; export const FETCH_USER_AND_COURSE = 'FETCH_USER_AND_COURSE'; diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index 6b211a4d5c..bf9f808203 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -23,27 +23,27 @@ import * as React from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, useParams } from 'react-router'; import { NavLink } from 'react-router-dom'; -import { numberRegExp } from 'src/features/academy/AcademyTypes'; - -import defaultCoverImage from '../../assets/default_cover_image.jpg'; +import defaultCoverImage from 'src/assets/default_cover_image.jpg'; import { acknowledgeNotifications, fetchAssessmentOverviews, submitAssessment -} from '../application/actions/SessionActions'; -import { Role } from '../application/ApplicationTypes'; +} from 'src/commons/application/actions/SessionActions'; +import { Role } from 'src/commons/application/ApplicationTypes'; import AssessmentWorkspace, { AssessmentWorkspaceProps -} from '../assessmentWorkspace/AssessmentWorkspace'; -import ContentDisplay from '../ContentDisplay'; -import ControlButton from '../ControlButton'; -import Markdown from '../Markdown'; -import NotificationBadge from '../notificationBadge/NotificationBadge'; -import { filterNotificationsByAssessment } from '../notificationBadge/NotificationBadgeHelper'; -import Constants from '../utils/Constants'; -import { beforeNow, getPrettyDate } from '../utils/DateHelper'; -import { useResponsive, useTypedSelector } from '../utils/Hooks'; -import { assessmentTypeLink, convertParamToInt } from '../utils/ParamParseHelper'; +} from 'src/commons/assessmentWorkspace/AssessmentWorkspace'; +import ContentDisplay from 'src/commons/ContentDisplay'; +import ControlButton from 'src/commons/ControlButton'; +import Markdown from 'src/commons/Markdown'; +import NotificationBadge from 'src/commons/notificationBadge/NotificationBadge'; +import { filterNotificationsByAssessment } from 'src/commons/notificationBadge/NotificationBadgeHelper'; +import Constants from 'src/commons/utils/Constants'; +import { beforeNow, getPrettyDate } from 'src/commons/utils/DateHelper'; +import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; +import { assessmentTypeLink, convertParamToInt } from 'src/commons/utils/ParamParseHelper'; +import { numberRegExp } from 'src/features/academy/AcademyTypes'; + import AssessmentNotFound from './AssessmentNotFound'; import { AssessmentConfiguration, diff --git a/src/commons/assessment/AssessmentTypes.ts b/src/commons/assessment/AssessmentTypes.ts index 0169f52ad0..66d34312d2 100644 --- a/src/commons/assessment/AssessmentTypes.ts +++ b/src/commons/assessment/AssessmentTypes.ts @@ -1,6 +1,5 @@ import { Chapter, SourceError, Variant } from 'js-slang/dist/types'; - -import { ExternalLibrary, ExternalLibraryName } from '../application/types/ExternalTypes'; +import { ExternalLibrary, ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; export const FETCH_ASSESSMENT_OVERVIEWS = 'FETCH_ASSESSMENT_OVERVIEWS'; export const SUBMIT_ASSESSMENT = 'SUBMIT_ASSESSMENT'; diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx index bd6a6f94b7..b5a29a8e4b 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspace.tsx @@ -16,18 +16,8 @@ import { isEqual } from 'lodash'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router'; -import { onClickProgress } from 'src/features/assessments/AssessmentUtils'; -import { mobileOnlyTabIds } from 'src/pages/playground/PlaygroundTabs'; - -import { initSession, log } from '../../features/eventLogging'; -import { - CodeDelta, - Input, - KeyboardCommand, - SelectionRange -} from '../../features/sourceRecorder/SourceRecorderTypes'; -import { fetchAssessment, submitAnswer } from '../application/actions/SessionActions'; -import { defaultWorkspaceManager } from '../application/ApplicationTypes'; +import { fetchAssessment, submitAnswer } from 'src/commons/application/actions/SessionActions'; +import { defaultWorkspaceManager } from 'src/commons/application/ApplicationTypes'; import { AssessmentConfiguration, AutogradingResult, @@ -38,37 +28,37 @@ import { Library, QuestionTypes, Testcase -} from '../assessment/AssessmentTypes'; -import { ControlBarProps } from '../controlBar/ControlBar'; -import { ControlBarChapterSelect } from '../controlBar/ControlBarChapterSelect'; -import { ControlBarClearButton } from '../controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../controlBar/ControlBarEvalButton'; -import { ControlBarNextButton } from '../controlBar/ControlBarNextButton'; -import { ControlBarPreviousButton } from '../controlBar/ControlBarPreviousButton'; -import { ControlBarQuestionViewButton } from '../controlBar/ControlBarQuestionViewButton'; -import { ControlBarResetButton } from '../controlBar/ControlBarResetButton'; -import { ControlBarRunButton } from '../controlBar/ControlBarRunButton'; -import { ControlButtonSaveButton } from '../controlBar/ControlBarSaveButton'; -import ControlButton from '../ControlButton'; +} from 'src/commons/assessment/AssessmentTypes'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { ControlBarNextButton } from 'src/commons/controlBar/ControlBarNextButton'; +import { ControlBarPreviousButton } from 'src/commons/controlBar/ControlBarPreviousButton'; +import { ControlBarQuestionViewButton } from 'src/commons/controlBar/ControlBarQuestionViewButton'; +import { ControlBarResetButton } from 'src/commons/controlBar/ControlBarResetButton'; +import { ControlBarRunButton } from 'src/commons/controlBar/ControlBarRunButton'; +import { ControlButtonSaveButton } from 'src/commons/controlBar/ControlBarSaveButton'; +import ControlButton from 'src/commons/ControlButton'; import { convertEditorTabStateToProps, NormalEditorContainerProps -} from '../editor/EditorContainer'; -import { Position } from '../editor/EditorTypes'; -import Markdown from '../Markdown'; -import { MobileSideContentProps } from '../mobileWorkspace/mobileSideContent/MobileSideContent'; -import MobileWorkspace, { MobileWorkspaceProps } from '../mobileWorkspace/MobileWorkspace'; -import { SideContentProps } from '../sideContent/SideContent'; -import SideContentAutograder from '../sideContent/SideContentAutograder'; -import SideContentContestLeaderboard from '../sideContent/SideContentContestLeaderboard'; -import SideContentContestVotingContainer from '../sideContent/SideContentContestVotingContainer'; -import SideContentToneMatrix from '../sideContent/SideContentToneMatrix'; -import { SideContentTab, SideContentType } from '../sideContent/SideContentTypes'; -import Constants from '../utils/Constants'; -import { useResponsive, useTypedSelector } from '../utils/Hooks'; -import { assessmentTypeLink } from '../utils/ParamParseHelper'; -import { assertType } from '../utils/TypeHelper'; -import Workspace, { WorkspaceProps } from '../workspace/Workspace'; +} from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import Markdown from 'src/commons/Markdown'; +import { MobileSideContentProps } from 'src/commons/mobileWorkspace/mobileSideContent/MobileSideContent'; +import MobileWorkspace, { MobileWorkspaceProps } from 'src/commons/mobileWorkspace/MobileWorkspace'; +import { SideContentProps } from 'src/commons/sideContent/SideContent'; +import SideContentAutograder from 'src/commons/sideContent/SideContentAutograder'; +import SideContentContestLeaderboard from 'src/commons/sideContent/SideContentContestLeaderboard'; +import SideContentContestVotingContainer from 'src/commons/sideContent/SideContentContestVotingContainer'; +import SideContentToneMatrix from 'src/commons/sideContent/SideContentToneMatrix'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import Constants from 'src/commons/utils/Constants'; +import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; +import { assertType } from 'src/commons/utils/TypeHelper'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { beginClearContext, browseReplHistoryDown, @@ -90,8 +80,18 @@ import { updateEditorValue, updateHasUnsavedChanges, updateReplValue -} from '../workspace/WorkspaceActions'; -import { WorkspaceLocation, WorkspaceState } from '../workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation, WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; +import { onClickProgress } from 'src/features/assessments/AssessmentUtils'; +import { initSession, log } from 'src/features/eventLogging'; +import { + CodeDelta, + Input, + KeyboardCommand, + SelectionRange +} from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { mobileOnlyTabIds } from 'src/pages/playground/PlaygroundTabs'; + import AssessmentWorkspaceGradingResult from './AssessmentWorkspaceGradingResult'; export type AssessmentWorkspaceProps = { assessmentId: number; diff --git a/src/commons/assessmentWorkspace/AssessmentWorkspaceGradingResult.tsx b/src/commons/assessmentWorkspace/AssessmentWorkspaceGradingResult.tsx index 450cf6f0f2..7c5f04ea7b 100644 --- a/src/commons/assessmentWorkspace/AssessmentWorkspaceGradingResult.tsx +++ b/src/commons/assessmentWorkspace/AssessmentWorkspaceGradingResult.tsx @@ -1,8 +1,7 @@ import { Divider, HTMLTable, Text } from '@blueprintjs/core'; import React from 'react'; - -import Markdown from '../Markdown'; -import { getPrettyDate } from '../utils/DateHelper'; +import Markdown from 'src/commons/Markdown'; +import { getPrettyDate } from 'src/commons/utils/DateHelper'; type AssessmentWorkspaceGradingResultProps = StateProps; diff --git a/src/commons/collabEditing/CollabEditingActions.ts b/src/commons/collabEditing/CollabEditingActions.ts index f8a75beb55..1125068fb1 100644 --- a/src/commons/collabEditing/CollabEditingActions.ts +++ b/src/commons/collabEditing/CollabEditingActions.ts @@ -1,6 +1,6 @@ +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import { action } from 'typesafe-actions'; // EDITING -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import { SET_EDITOR_SESSION_ID, SET_SHAREDB_CONNECTED } from './CollabEditingTypes'; export const setEditorSessionId = (workspaceLocation: WorkspaceLocation, editorSessionId: string) => diff --git a/src/commons/collabEditing/CollabEditingHelper.ts b/src/commons/collabEditing/CollabEditingHelper.ts index 448e86a88e..96cceac4ac 100644 --- a/src/commons/collabEditing/CollabEditingHelper.ts +++ b/src/commons/collabEditing/CollabEditingHelper.ts @@ -1,4 +1,4 @@ -import Constants from '../utils/Constants'; +import Constants from 'src/commons/utils/Constants'; const protocolMap = { 'http:': 'ws:', diff --git a/src/commons/controlBar/ControlBarAutorunButtons.tsx b/src/commons/controlBar/ControlBarAutorunButtons.tsx index 1ce26e048f..2bd4c99c93 100644 --- a/src/commons/controlBar/ControlBarAutorunButtons.tsx +++ b/src/commons/controlBar/ControlBarAutorunButtons.tsx @@ -1,9 +1,9 @@ import { Switch } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React from 'react'; +import ControlButton from 'src/commons/ControlButton'; +import { useResponsive } from 'src/commons/utils/Hooks'; -import ControlButton from '../ControlButton'; -import { useResponsive } from '../utils/Hooks'; import { ControlBarRunButton } from './ControlBarRunButton'; type ControlBarAutorunButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarChapterSelect.tsx b/src/commons/controlBar/ControlBarChapterSelect.tsx index fc611dca3f..8a3edd06b0 100644 --- a/src/commons/controlBar/ControlBarChapterSelect.tsx +++ b/src/commons/controlBar/ControlBarChapterSelect.tsx @@ -4,7 +4,6 @@ import { Tooltip2 } from '@blueprintjs/popover2'; import { ItemListRenderer, ItemRenderer, Select } from '@blueprintjs/select'; import { Chapter, Variant } from 'js-slang/dist/types'; import React from 'react'; - import { fullJSLanguage, fullTSLanguage, @@ -14,9 +13,9 @@ import { schemeLanguages, sourceLanguages, styliseSublanguage -} from '../application/ApplicationTypes'; -import Constants from '../utils/Constants'; -import { useTypedSelector } from '../utils/Hooks'; +} from 'src/commons/application/ApplicationTypes'; +import Constants from 'src/commons/utils/Constants'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; type ControlBarChapterSelectProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarClearButton.tsx b/src/commons/controlBar/ControlBarClearButton.tsx index fdb87f5c41..326bee4774 100644 --- a/src/commons/controlBar/ControlBarClearButton.tsx +++ b/src/commons/controlBar/ControlBarClearButton.tsx @@ -1,7 +1,6 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarClearButtonProps = { handleReplOutputClear: () => void; diff --git a/src/commons/controlBar/ControlBarCloseButton.tsx b/src/commons/controlBar/ControlBarCloseButton.tsx index dfc8475303..06632a23ea 100644 --- a/src/commons/controlBar/ControlBarCloseButton.tsx +++ b/src/commons/controlBar/ControlBarCloseButton.tsx @@ -1,7 +1,6 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarCloseButtonProps = { handleClose: () => void; diff --git a/src/commons/controlBar/ControlBarEvalButton.tsx b/src/commons/controlBar/ControlBarEvalButton.tsx index 8096e3ef1e..7475b0ebd4 100644 --- a/src/commons/controlBar/ControlBarEvalButton.tsx +++ b/src/commons/controlBar/ControlBarEvalButton.tsx @@ -1,8 +1,7 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarEvalButtonProps = { handleReplEval: () => void; diff --git a/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx b/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx index 8e8b2890e8..51f2ce19a8 100644 --- a/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx +++ b/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx @@ -2,10 +2,9 @@ import { ButtonGroup, Classes, Intent } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import { PersistenceFile, PersistenceState } from '../../features/persistence/PersistenceTypes'; -import ControlButton from '../ControlButton'; -import { useResponsive } from '../utils/Hooks'; +import ControlButton from 'src/commons/ControlButton'; +import { useResponsive } from 'src/commons/utils/Hooks'; +import { PersistenceFile, PersistenceState } from 'src/features/persistence/PersistenceTypes'; export type ControlBarGoogleDriveButtonsProps = { isFolderModeEnabled: boolean; diff --git a/src/commons/controlBar/ControlBarNextButton.tsx b/src/commons/controlBar/ControlBarNextButton.tsx index 2723e18e72..237ae673e6 100644 --- a/src/commons/controlBar/ControlBarNextButton.tsx +++ b/src/commons/controlBar/ControlBarNextButton.tsx @@ -1,7 +1,7 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; +import ControlButton from 'src/commons/ControlButton'; -import ControlButton from '../ControlButton'; import { ControlBarReturnToAcademyButton } from './ControlBarReturnToAcademyButton'; type ControlBarNextButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarPreviousButton.tsx b/src/commons/controlBar/ControlBarPreviousButton.tsx index d045c55f3a..d41af23339 100644 --- a/src/commons/controlBar/ControlBarPreviousButton.tsx +++ b/src/commons/controlBar/ControlBarPreviousButton.tsx @@ -1,7 +1,6 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarPreviousButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarQuestionViewButton.tsx b/src/commons/controlBar/ControlBarQuestionViewButton.tsx index fe01b3e639..8801ce03ba 100644 --- a/src/commons/controlBar/ControlBarQuestionViewButton.tsx +++ b/src/commons/controlBar/ControlBarQuestionViewButton.tsx @@ -1,6 +1,5 @@ import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; /** * @prop questionProgress a tuple of (current question number, question length) where diff --git a/src/commons/controlBar/ControlBarResetButton.tsx b/src/commons/controlBar/ControlBarResetButton.tsx index 4a299a853a..bf5ee191c2 100644 --- a/src/commons/controlBar/ControlBarResetButton.tsx +++ b/src/commons/controlBar/ControlBarResetButton.tsx @@ -1,7 +1,6 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarResetButtonProps = { onClick?(): any; diff --git a/src/commons/controlBar/ControlBarReturnToAcademyButton.tsx b/src/commons/controlBar/ControlBarReturnToAcademyButton.tsx index b15bee36a1..e13e2b400d 100644 --- a/src/commons/controlBar/ControlBarReturnToAcademyButton.tsx +++ b/src/commons/controlBar/ControlBarReturnToAcademyButton.tsx @@ -1,7 +1,6 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarReturnToAcademyButtonProps = { onClick?(): any; diff --git a/src/commons/controlBar/ControlBarRunButton.tsx b/src/commons/controlBar/ControlBarRunButton.tsx index c462356672..6fd11ae08e 100644 --- a/src/commons/controlBar/ControlBarRunButton.tsx +++ b/src/commons/controlBar/ControlBarRunButton.tsx @@ -2,8 +2,7 @@ import { Position } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlButtonRunButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarSaveButton.tsx b/src/commons/controlBar/ControlBarSaveButton.tsx index fe87e59d36..1eabdcc2e6 100644 --- a/src/commons/controlBar/ControlBarSaveButton.tsx +++ b/src/commons/controlBar/ControlBarSaveButton.tsx @@ -1,8 +1,7 @@ import { Intent } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarSaveButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarSessionButton.tsx b/src/commons/controlBar/ControlBarSessionButton.tsx index 46d487110c..8d61751b8d 100644 --- a/src/commons/controlBar/ControlBarSessionButton.tsx +++ b/src/commons/controlBar/ControlBarSessionButton.tsx @@ -3,10 +3,12 @@ import { IconNames } from '@blueprintjs/icons'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; - -import { checkSessionIdExists, createNewSession } from '../collabEditing/CollabEditingHelper'; -import ControlButton from '../ControlButton'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; +import { + checkSessionIdExists, + createNewSession +} from 'src/commons/collabEditing/CollabEditingHelper'; +import ControlButton from 'src/commons/ControlButton'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; type ControlBarSessionButtonsProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarShareButton.tsx b/src/commons/controlBar/ControlBarShareButton.tsx index d5ddbab6bd..ea130d5245 100644 --- a/src/commons/controlBar/ControlBarShareButton.tsx +++ b/src/commons/controlBar/ControlBarShareButton.tsx @@ -3,9 +3,8 @@ import { IconNames } from '@blueprintjs/icons'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; - -import ControlButton from '../ControlButton'; -import Constants from '../utils/Constants'; +import ControlButton from 'src/commons/ControlButton'; +import Constants from 'src/commons/utils/Constants'; type ControlBarShareButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/ControlBarToggleEditModeButton.tsx b/src/commons/controlBar/ControlBarToggleEditModeButton.tsx index 3ed763c6d8..ac7c0b049f 100644 --- a/src/commons/controlBar/ControlBarToggleEditModeButton.tsx +++ b/src/commons/controlBar/ControlBarToggleEditModeButton.tsx @@ -1,8 +1,7 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarToggleEditModeButtonProps = { toggleEditMode?(): void; diff --git a/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx b/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx index 5be7620b71..af81668a8b 100644 --- a/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx +++ b/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx @@ -2,8 +2,7 @@ import { Colors } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarToggleFolderModeButtonProps = { isFolderModeEnabled: boolean; diff --git a/src/commons/controlBar/github/ControlBarDisplayMCQButton.tsx b/src/commons/controlBar/github/ControlBarDisplayMCQButton.tsx index 0bb0fd8a72..ec7f1d54ee 100644 --- a/src/commons/controlBar/github/ControlBarDisplayMCQButton.tsx +++ b/src/commons/controlBar/github/ControlBarDisplayMCQButton.tsx @@ -1,6 +1,5 @@ import { IconNames } from '@blueprintjs/icons'; - -import ControlButton from '../../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type ControlBarDisplayMCQButtonProps = DispatchProps & StateProps; diff --git a/src/commons/controlBar/github/ControlBarGitHubButtons.tsx b/src/commons/controlBar/github/ControlBarGitHubButtons.tsx index 67579cd60e..247315a0aa 100644 --- a/src/commons/controlBar/github/ControlBarGitHubButtons.tsx +++ b/src/commons/controlBar/github/ControlBarGitHubButtons.tsx @@ -3,10 +3,9 @@ import { IconNames } from '@blueprintjs/icons'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import { Octokit } from '@octokit/rest'; import * as React from 'react'; +import ControlButton from 'src/commons/ControlButton'; import { useResponsive } from 'src/commons/utils/Hooks'; - -import { GitHubSaveInfo } from '../../../features/github/GitHubTypes'; -import ControlButton from '../../ControlButton'; +import { GitHubSaveInfo } from 'src/features/github/GitHubTypes'; export type ControlBarGitHubButtonsProps = { isFolderModeEnabled: boolean; diff --git a/src/commons/controlBar/github/ControlBarGitHubLoginButton.tsx b/src/commons/controlBar/github/ControlBarGitHubLoginButton.tsx index 89aef8764e..24479fc136 100644 --- a/src/commons/controlBar/github/ControlBarGitHubLoginButton.tsx +++ b/src/commons/controlBar/github/ControlBarGitHubLoginButton.tsx @@ -1,10 +1,9 @@ import { ButtonGroup } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; +import ControlButton from 'src/commons/ControlButton'; import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; -import ControlButton from '../../ControlButton'; - export type ControlBarGitHubLoginButtonProps = { onClickLogIn: () => void; onClickLogOut: () => void; diff --git a/src/commons/controlBar/github/ControlBarTaskAddButton.tsx b/src/commons/controlBar/github/ControlBarTaskAddButton.tsx index edb49a79a6..ddec2c71d1 100644 --- a/src/commons/controlBar/github/ControlBarTaskAddButton.tsx +++ b/src/commons/controlBar/github/ControlBarTaskAddButton.tsx @@ -1,8 +1,7 @@ import { IconNames } from '@blueprintjs/icons'; - -import ControlButton from '../../ControlButton'; -import { maximumTasksPerMission } from '../../githubAssessments/GitHubMissionDataUtils'; -import { showWarningMessage } from '../../utils/notifications/NotificationsHelper'; +import ControlButton from 'src/commons/ControlButton'; +import { maximumTasksPerMission } from 'src/commons/githubAssessments/GitHubMissionDataUtils'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type ControlBarTaskAddButtonProps = { addNewQuestion: () => void; diff --git a/src/commons/controlBar/github/ControlBarTaskDeleteButton.tsx b/src/commons/controlBar/github/ControlBarTaskDeleteButton.tsx index e385314a70..07327167d0 100644 --- a/src/commons/controlBar/github/ControlBarTaskDeleteButton.tsx +++ b/src/commons/controlBar/github/ControlBarTaskDeleteButton.tsx @@ -1,8 +1,7 @@ import { IconNames } from '@blueprintjs/icons'; - -import ControlButton from '../../ControlButton'; -import { showSimpleConfirmDialog } from '../../utils/DialogHelper'; -import { showWarningMessage } from '../../utils/notifications/NotificationsHelper'; +import ControlButton from 'src/commons/ControlButton'; +import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type ControlBarTaskDeleteButtonProps = { deleteCurrentQuestion: () => void; diff --git a/src/commons/documentation/Documentation.ts b/src/commons/documentation/Documentation.ts index 25b1f332bf..7e39452187 100644 --- a/src/commons/documentation/Documentation.ts +++ b/src/commons/documentation/Documentation.ts @@ -1,8 +1,7 @@ import { SourceDocumentation } from 'js-slang'; +import { externalLibraries } from 'src/commons/application/types/ExternalTypes'; import { deviceTypes } from 'src/features/remoteExecution/RemoteExecutionTypes'; -import { externalLibraries } from '../application/types/ExternalTypes'; - const externalLibrariesDocumentation = {}; const MAX_CAPTION_LENGTH = 27; diff --git a/src/commons/dropdown/Dropdown.tsx b/src/commons/dropdown/Dropdown.tsx index d6beb7b998..235564dcce 100644 --- a/src/commons/dropdown/Dropdown.tsx +++ b/src/commons/dropdown/Dropdown.tsx @@ -3,11 +3,11 @@ import { IconNames } from '@blueprintjs/icons'; import { Popover2 } from '@blueprintjs/popover2'; import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; +import { logOut } from 'src/commons/application/actions/CommonsActions'; +import ControlButton from 'src/commons/ControlButton'; +import Profile from 'src/commons/profile/Profile'; +import { useSession } from 'src/commons/utils/Hooks'; -import { logOut } from '../application/actions/CommonsActions'; -import ControlButton from '../ControlButton'; -import Profile from '../profile/Profile'; -import { useSession } from '../utils/Hooks'; import DropdownAbout from './DropdownAbout'; import DropdownCourses from './DropdownCourses'; import DropdownCreateCourse from './DropdownCreateCourse'; diff --git a/src/commons/dropdown/DropdownAbout.tsx b/src/commons/dropdown/DropdownAbout.tsx index 6163db2b04..c24b0ac11b 100644 --- a/src/commons/dropdown/DropdownAbout.tsx +++ b/src/commons/dropdown/DropdownAbout.tsx @@ -1,8 +1,7 @@ import { Classes, Dialog } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - -import { Links } from '../utils/Constants'; +import { Links } from 'src/commons/utils/Constants'; type DialogProps = { isOpen: boolean; diff --git a/src/commons/dropdown/DropdownCourses.tsx b/src/commons/dropdown/DropdownCourses.tsx index ff067baf5f..d80013757e 100644 --- a/src/commons/dropdown/DropdownCourses.tsx +++ b/src/commons/dropdown/DropdownCourses.tsx @@ -2,9 +2,8 @@ import { Classes, Dialog, HTMLSelect } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; import { useNavigate } from 'react-router'; - -import { Role } from '../application/ApplicationTypes'; -import { UserCourse } from '../application/types/SessionTypes'; +import { Role } from 'src/commons/application/ApplicationTypes'; +import { UserCourse } from 'src/commons/application/types/SessionTypes'; type DialogProps = { isOpen: boolean; diff --git a/src/commons/dropdown/DropdownCreateCourse.tsx b/src/commons/dropdown/DropdownCreateCourse.tsx index 7c5b7f70e1..a3ef381ec5 100644 --- a/src/commons/dropdown/DropdownCreateCourse.tsx +++ b/src/commons/dropdown/DropdownCreateCourse.tsx @@ -15,13 +15,12 @@ import { IconNames } from '@blueprintjs/icons'; import { Chapter, Variant } from 'js-slang/dist/types'; import * as React from 'react'; import { useDispatch } from 'react-redux'; +import { sourceLanguages } from 'src/commons/application/ApplicationTypes'; +import { UpdateCourseConfiguration } from 'src/commons/application/types/SessionTypes'; +import Markdown from 'src/commons/Markdown'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; import { createCourse } from 'src/features/academy/AcademyActions'; - -import { CourseHelpTextEditorTab } from '../../pages/academy/adminPanel/subcomponents/CourseConfigPanel'; -import { sourceLanguages } from '../application/ApplicationTypes'; -import { UpdateCourseConfiguration } from '../application/types/SessionTypes'; -import Markdown from '../Markdown'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; +import { CourseHelpTextEditorTab } from 'src/pages/academy/adminPanel/subcomponents/CourseConfigPanel'; type DialogProps = { isOpen: boolean; diff --git a/src/commons/dropdown/DropdownHelp.tsx b/src/commons/dropdown/DropdownHelp.tsx index c333b97a3b..3c558e63c2 100644 --- a/src/commons/dropdown/DropdownHelp.tsx +++ b/src/commons/dropdown/DropdownHelp.tsx @@ -1,10 +1,9 @@ import { Classes, Dialog } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - -import Markdown from '../Markdown'; -import { Links } from '../utils/Constants'; -import { useTypedSelector } from '../utils/Hooks'; +import Markdown from 'src/commons/Markdown'; +import { Links } from 'src/commons/utils/Constants'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; type DialogProps = { isOpen: boolean; diff --git a/src/commons/dropdown/DropdownSettings.tsx b/src/commons/dropdown/DropdownSettings.tsx index aed8814c23..f2ff1b8f87 100644 --- a/src/commons/dropdown/DropdownSettings.tsx +++ b/src/commons/dropdown/DropdownSettings.tsx @@ -2,8 +2,7 @@ import { Classes, Dialog, FormGroup, HTMLSelect, Icon, PopoverPosition } from '@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import { useContext, useMemo } from 'react'; - -import { EditorBinding, WorkspaceSettingsContext } from '../WorkspaceSettingsContext'; +import { EditorBinding, WorkspaceSettingsContext } from 'src/commons/WorkspaceSettingsContext'; type DialogProps = { isOpen: boolean; diff --git a/src/commons/editingOverviewCard/EditingOverviewCard.tsx b/src/commons/editingOverviewCard/EditingOverviewCard.tsx index 6158efc3c0..68b204893c 100644 --- a/src/commons/editingOverviewCard/EditingOverviewCard.tsx +++ b/src/commons/editingOverviewCard/EditingOverviewCard.tsx @@ -17,14 +17,13 @@ import { ItemRenderer, Select } from '@blueprintjs/select'; import React, { useState } from 'react'; import { NavLink } from 'react-router-dom'; import Textarea from 'react-textarea-autosize'; - -import defaultCoverImage from '../../assets/default_cover_image.jpg'; -import { AssessmentOverview, AssessmentType } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; -import Markdown from '../Markdown'; -import Constants from '../utils/Constants'; -import { getPrettyDate } from '../utils/DateHelper'; -import { exportXml, storeLocalAssessmentOverview } from '../XMLParser/XMLParserHelper'; +import defaultCoverImage from 'src/assets/default_cover_image.jpg'; +import { AssessmentOverview, AssessmentType } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import Markdown from 'src/commons/Markdown'; +import Constants from 'src/commons/utils/Constants'; +import { getPrettyDate } from 'src/commons/utils/DateHelper'; +import { exportXml, storeLocalAssessmentOverview } from 'src/commons/XMLParser/XMLParserHelper'; type EditingOverviewCardProps = DispatchProps & StateProps; diff --git a/src/commons/editingWorkspace/EditingWorkspace.tsx b/src/commons/editingWorkspace/EditingWorkspace.tsx index ff84f95e69..fe1fb38674 100644 --- a/src/commons/editingWorkspace/EditingWorkspace.tsx +++ b/src/commons/editingWorkspace/EditingWorkspace.tsx @@ -13,8 +13,7 @@ import { Chapter, Variant } from 'js-slang/dist/types'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router'; - -import { submitAnswer } from '../application/actions/SessionActions'; +import { submitAnswer } from 'src/commons/application/actions/SessionActions'; import { Assessment, AssessmentOverview, @@ -24,33 +23,33 @@ import { Question, QuestionTypes, Testcase -} from '../assessment/AssessmentTypes'; -import { ControlBarProps } from '../controlBar/ControlBar'; -import { ControlBarClearButton } from '../controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../controlBar/ControlBarEvalButton'; -import { ControlBarNextButton } from '../controlBar/ControlBarNextButton'; -import { ControlBarPreviousButton } from '../controlBar/ControlBarPreviousButton'; -import { ControlBarQuestionViewButton } from '../controlBar/ControlBarQuestionViewButton'; -import { ControlBarResetButton } from '../controlBar/ControlBarResetButton'; -import { ControlBarRunButton } from '../controlBar/ControlBarRunButton'; -import { ControlButtonSaveButton } from '../controlBar/ControlBarSaveButton'; -import { ControlBarToggleEditModeButton } from '../controlBar/ControlBarToggleEditModeButton'; -import ControlButton from '../ControlButton'; -import { AutograderTab } from '../editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab'; -import DeploymentTab from '../editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab'; -import GradingTab from '../editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab'; -import ManageQuestionTab from '../editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab'; -import MCQQuestionTemplateTab from '../editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab'; -import ProgrammingQuestionTemplateTab from '../editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab'; -import { TextAreaContent } from '../editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent'; -import { convertEditorTabStateToProps } from '../editor/EditorContainer'; -import { Position } from '../editor/EditorTypes'; -import Markdown from '../Markdown'; -import { SideContentProps } from '../sideContent/SideContent'; -import SideContentToneMatrix from '../sideContent/SideContentToneMatrix'; -import { SideContentTab, SideContentType } from '../sideContent/SideContentTypes'; -import { useTypedSelector } from '../utils/Hooks'; -import Workspace, { WorkspaceProps } from '../workspace/Workspace'; +} from 'src/commons/assessment/AssessmentTypes'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { ControlBarNextButton } from 'src/commons/controlBar/ControlBarNextButton'; +import { ControlBarPreviousButton } from 'src/commons/controlBar/ControlBarPreviousButton'; +import { ControlBarQuestionViewButton } from 'src/commons/controlBar/ControlBarQuestionViewButton'; +import { ControlBarResetButton } from 'src/commons/controlBar/ControlBarResetButton'; +import { ControlBarRunButton } from 'src/commons/controlBar/ControlBarRunButton'; +import { ControlButtonSaveButton } from 'src/commons/controlBar/ControlBarSaveButton'; +import { ControlBarToggleEditModeButton } from 'src/commons/controlBar/ControlBarToggleEditModeButton'; +import ControlButton from 'src/commons/ControlButton'; +import { AutograderTab } from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab'; +import DeploymentTab from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab'; +import GradingTab from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab'; +import ManageQuestionTab from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab'; +import MCQQuestionTemplateTab from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab'; +import ProgrammingQuestionTemplateTab from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab'; +import { TextAreaContent } from 'src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent'; +import { convertEditorTabStateToProps } from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import Markdown from 'src/commons/Markdown'; +import { SideContentProps } from 'src/commons/sideContent/SideContent'; +import SideContentToneMatrix from 'src/commons/sideContent/SideContentToneMatrix'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { beginClearContext, browseReplHistoryDown, @@ -71,13 +70,13 @@ import { updateHasUnsavedChanges, updateReplValue, updateWorkspace -} from '../workspace/WorkspaceActions'; -import { WorkspaceLocation, WorkspaceState } from '../workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation, WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; import { retrieveLocalAssessment, storeLocalAssessment, storeLocalAssessmentOverview -} from '../XMLParser/XMLParserHelper'; +} from 'src/commons/XMLParser/XMLParserHelper'; export type EditingWorkspaceProps = { assessmentId: number; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx index e340a98042..d1ea3b4a7d 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx @@ -1,14 +1,14 @@ import { Card, Elevation, H6 } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - import { Assessment, IProgrammingQuestion, Testcase, testcaseTemplate -} from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; +} from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; + import { getValueFromPath } from './EditingWorkspaceSideContentHelper'; import TextAreaContent from './EditingWorkspaceSideContentTextAreaContent'; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab.tsx index 4485f14789..1b44736cd4 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentDeploymentTab.tsx @@ -3,15 +3,19 @@ import { IconNames } from '@blueprintjs/icons'; import { ItemRenderer, Select } from '@blueprintjs/select'; import { Chapter, Variant } from 'js-slang/dist/types'; import React from 'react'; - -import { SALanguage, sourceLanguages, styliseSublanguage } from '../application/ApplicationTypes'; +import { + SALanguage, + sourceLanguages, + styliseSublanguage +} from 'src/commons/application/ApplicationTypes'; import { External, externalLibraries, ExternalLibraryName -} from '../application/types/ExternalTypes'; -import { Assessment, emptyLibrary, Library } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; +} from 'src/commons/application/types/ExternalTypes'; +import { Assessment, emptyLibrary, Library } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; + import { assignToPath, getValueFromPath } from './EditingWorkspaceSideContentHelper'; import TextAreaContent from './EditingWorkspaceSideContentTextAreaContent'; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab.tsx index a9f1bb7ca3..8162b041cf 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentGradingTab.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; +import { Assessment } from 'src/commons/assessment/AssessmentTypes'; -import { Assessment } from '../assessment/AssessmentTypes'; import { limitNumberRange } from './EditingWorkspaceSideContentHelper'; import TextAreaContent from './EditingWorkspaceSideContentTextAreaContent'; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx index 1c3db43464..c7d22ebf9b 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx @@ -2,10 +2,13 @@ import { Button, ButtonGroup, Classes, Dialog, Intent } from '@blueprintjs/core' import { IconNames } from '@blueprintjs/icons'; import React, { useState } from 'react'; import { useNavigate } from 'react-router'; - -import { Assessment, mcqTemplate, programmingTemplate } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; -import Markdown from '../Markdown'; +import { + Assessment, + mcqTemplate, + programmingTemplate +} from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import Markdown from 'src/commons/Markdown'; type ManageQuestionTabProps = DispatchProps & StateProps; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab.tsx index 20bf12e183..a6940185c8 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentMcqQuestionTemplateTab.tsx @@ -1,9 +1,9 @@ import { Card } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; +import { Assessment, IMCQQuestion } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; -import { Assessment, IMCQQuestion } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; import { limitNumberRange } from './EditingWorkspaceSideContentHelper'; import TextAreaContent from './EditingWorkspaceSideContentTextAreaContent'; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab.tsx index a65345c179..14aa343e7b 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentProgrammingQuestionTemplateTab.tsx @@ -3,10 +3,10 @@ import { IconNames } from '@blueprintjs/icons'; import { ItemRenderer, Select } from '@blueprintjs/select'; import React, { useState } from 'react'; import AceEditor from 'react-ace'; +import { Assessment } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import { WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; -import { Assessment } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; -import { WorkspaceState } from '../workspace/WorkspaceTypes'; import { assignToPath, getValueFromPath } from './EditingWorkspaceSideContentHelper'; type QuestionEditorProps = DispatchProps & StateProps; diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx index e737cbeb93..52805ad64e 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; import Textarea from 'react-textarea-autosize'; +import { Assessment } from 'src/commons/assessment/AssessmentTypes'; +import Markdown from 'src/commons/Markdown'; -import { Assessment } from '../assessment/AssessmentTypes'; -import Markdown from '../Markdown'; import { assignToPath, getValueFromPath } from './EditingWorkspaceSideContentHelper'; type TextAreaContentProps = DispatchProps & StateProps; diff --git a/src/commons/editor/Editor.tsx b/src/commons/editor/Editor.tsx index 346ea30ad7..17182ca20c 100644 --- a/src/commons/editor/Editor.tsx +++ b/src/commons/editor/Editor.tsx @@ -21,8 +21,8 @@ import useNavigation from './UseNavigation'; import useRefactor from './UseRefactor'; import useShareAce from './UseShareAce'; import useTypeInference from './UseTypeInference'; -import { getModeString, selectMode } from '../utils/AceHelper'; -import { EditorBinding } from '../WorkspaceSettingsContext'; +import { getModeString, selectMode } from 'src/commons/utils/AceHelper'; +import { EditorBinding } from 'src/commons/WorkspaceSettingsContext'; import { IAceEditor } from 'react-ace/lib/types'; export type EditorKeyBindingHandlers = { [name in KeyFunction]?: () => void }; diff --git a/src/commons/editor/EditorContainer.tsx b/src/commons/editor/EditorContainer.tsx index 8fbe71799d..9b98278687 100644 --- a/src/commons/editor/EditorContainer.tsx +++ b/src/commons/editor/EditorContainer.tsx @@ -6,12 +6,12 @@ import 'ace-builds/webpack-resolver'; import _ from 'lodash'; import React from 'react'; - import SourcecastEditor, { SourceRecorderEditorProps -} from '../sourceRecorder/SourceRecorderEditor'; -import { EditorTabState } from '../workspace/WorkspaceTypes'; -import { WorkspaceSettingsContext } from '../WorkspaceSettingsContext'; +} from 'src/commons/sourceRecorder/SourceRecorderEditor'; +import { EditorTabState } from 'src/commons/workspace/WorkspaceTypes'; +import { WorkspaceSettingsContext } from 'src/commons/WorkspaceSettingsContext'; + import Editor, { EditorProps, EditorTabStateProps } from './Editor'; import EditorTabContainer from './tabs/EditorTabContainer'; diff --git a/src/commons/editor/UseNavigation.tsx b/src/commons/editor/UseNavigation.tsx index d98ba06e3f..32427bd24b 100644 --- a/src/commons/editor/UseNavigation.tsx +++ b/src/commons/editor/UseNavigation.tsx @@ -1,9 +1,9 @@ import { createContext, hasDeclaration } from 'js-slang'; import { Variant } from 'js-slang/dist/types'; import * as React from 'react'; +import { Documentation } from 'src/commons/documentation/Documentation'; +import { Links } from 'src/commons/utils/Constants'; -import { Documentation } from '../documentation/Documentation'; -import { Links } from '../utils/Constants'; import { EditorHook } from './Editor'; // EditorHook structure: diff --git a/src/commons/editor/UseShareAce.tsx b/src/commons/editor/UseShareAce.tsx index 037d95fcac..a1b81db46c 100644 --- a/src/commons/editor/UseShareAce.tsx +++ b/src/commons/editor/UseShareAce.tsx @@ -1,8 +1,8 @@ import * as Sentry from '@sentry/browser'; import sharedbAce from '@sourceacademy/sharedb-ace'; import * as React from 'react'; +import { checkSessionIdExists, getSessionUrl } from 'src/commons/collabEditing/CollabEditingHelper'; -import { checkSessionIdExists, getSessionUrl } from '../collabEditing/CollabEditingHelper'; import { EditorHook } from './Editor'; // EditorHook structure: diff --git a/src/commons/fileSystem/FileSystemReducer.ts b/src/commons/fileSystem/FileSystemReducer.ts index 6ab250c8ca..60bcebd6a5 100644 --- a/src/commons/fileSystem/FileSystemReducer.ts +++ b/src/commons/fileSystem/FileSystemReducer.ts @@ -1,7 +1,7 @@ import { Reducer } from 'redux'; +import { defaultFileSystem } from 'src/commons/application/ApplicationTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultFileSystem } from '../application/ApplicationTypes'; -import { SourceActionType } from '../utils/ActionsHelper'; import { FileSystemState, SET_IN_BROWSER_FILE_SYSTEM } from './FileSystemTypes'; export const FileSystemReducer: Reducer = ( diff --git a/src/commons/fileSystem/utils.ts b/src/commons/fileSystem/utils.ts index 36ecd146d5..203adeff45 100644 --- a/src/commons/fileSystem/utils.ts +++ b/src/commons/fileSystem/utils.ts @@ -1,9 +1,8 @@ import { FSModule } from 'browserfs/dist/node/core/FS'; import Stats from 'browserfs/dist/node/core/node_fs_stats'; import path from 'path'; - -import { WORKSPACE_BASE_PATHS } from '../../pages/fileSystem/createInBrowserFileSystem'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { WORKSPACE_BASE_PATHS } from 'src/pages/fileSystem/createInBrowserFileSystem'; type File = { path: string; diff --git a/src/commons/fileSystemView/FileSystemView.tsx b/src/commons/fileSystemView/FileSystemView.tsx index 88c3ee85bc..392d5c6fe1 100644 --- a/src/commons/fileSystemView/FileSystemView.tsx +++ b/src/commons/fileSystemView/FileSystemView.tsx @@ -2,10 +2,10 @@ import { Icon } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import path from 'path'; import React from 'react'; +import { showSimpleErrorDialog } from 'src/commons/utils/DialogHelper'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { showSimpleErrorDialog } from '../utils/DialogHelper'; -import { useTypedSelector } from '../utils/Hooks'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import FileSystemViewContextMenu from './FileSystemViewContextMenu'; import FileSystemViewIndentationPadding from './FileSystemViewIndentationPadding'; import FileSystemViewList from './FileSystemViewList'; diff --git a/src/commons/fileSystemView/FileSystemViewDirectoryNode.tsx b/src/commons/fileSystemView/FileSystemViewDirectoryNode.tsx index 0cd9b46a84..dc6191c213 100644 --- a/src/commons/fileSystemView/FileSystemViewDirectoryNode.tsx +++ b/src/commons/fileSystemView/FileSystemViewDirectoryNode.tsx @@ -4,11 +4,11 @@ import { FSModule } from 'browserfs/dist/node/core/FS'; import path from 'path'; import React from 'react'; import { useDispatch } from 'react-redux'; +import { rmdirRecursively } from 'src/commons/fileSystem/utils'; +import { showSimpleConfirmDialog, showSimpleErrorDialog } from 'src/commons/utils/DialogHelper'; +import { removeEditorTabsForDirectory } from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { rmdirRecursively } from '../fileSystem/utils'; -import { showSimpleConfirmDialog, showSimpleErrorDialog } from '../utils/DialogHelper'; -import { removeEditorTabsForDirectory } from '../workspace/WorkspaceActions'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import FileSystemViewContextMenu from './FileSystemViewContextMenu'; import FileSystemViewFileName from './FileSystemViewFileName'; import FileSystemViewIndentationPadding from './FileSystemViewIndentationPadding'; diff --git a/src/commons/fileSystemView/FileSystemViewFileName.tsx b/src/commons/fileSystemView/FileSystemViewFileName.tsx index 4800b99212..f98879abcd 100644 --- a/src/commons/fileSystemView/FileSystemViewFileName.tsx +++ b/src/commons/fileSystemView/FileSystemViewFileName.tsx @@ -2,13 +2,12 @@ import { FSModule } from 'browserfs/dist/node/core/FS'; import path from 'path'; import React from 'react'; import { useDispatch } from 'react-redux'; - -import { showSimpleErrorDialog } from '../utils/DialogHelper'; +import { showSimpleErrorDialog } from 'src/commons/utils/DialogHelper'; import { renameEditorTabForFile, renameEditorTabsForDirectory -} from '../workspace/WorkspaceActions'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; export type FileSystemViewFileNameProps = { workspaceLocation: WorkspaceLocation; diff --git a/src/commons/fileSystemView/FileSystemViewFileNode.tsx b/src/commons/fileSystemView/FileSystemViewFileNode.tsx index 503f721329..658adcbaf7 100644 --- a/src/commons/fileSystemView/FileSystemViewFileNode.tsx +++ b/src/commons/fileSystemView/FileSystemViewFileNode.tsx @@ -4,10 +4,10 @@ import { FSModule } from 'browserfs/dist/node/core/FS'; import path from 'path'; import React from 'react'; import { useDispatch } from 'react-redux'; +import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; +import { addEditorTab, removeEditorTabForFile } from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { showSimpleConfirmDialog } from '../utils/DialogHelper'; -import { addEditorTab, removeEditorTabForFile } from '../workspace/WorkspaceActions'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import FileSystemViewContextMenu from './FileSystemViewContextMenu'; import FileSystemViewFileName from './FileSystemViewFileName'; import FileSystemViewIndentationPadding from './FileSystemViewIndentationPadding'; diff --git a/src/commons/fileSystemView/FileSystemViewList.tsx b/src/commons/fileSystemView/FileSystemViewList.tsx index 8890f217d3..3bdaefbbf2 100644 --- a/src/commons/fileSystemView/FileSystemViewList.tsx +++ b/src/commons/fileSystemView/FileSystemViewList.tsx @@ -2,9 +2,9 @@ import { Spinner, SpinnerSize } from '@blueprintjs/core'; import { FSModule } from 'browserfs/dist/node/core/FS'; import path from 'path'; import React from 'react'; +import Delay from 'src/commons/delay/Delay'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import Delay from '../delay/Delay'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import FileSystemViewDirectoryNode from './FileSystemViewDirectoryNode'; import FileSystemViewFileNode from './FileSystemViewFileNode'; diff --git a/src/commons/gitHubOverlay/FileExplorerDialog.tsx b/src/commons/gitHubOverlay/FileExplorerDialog.tsx index e72c7e7dd5..fcf46012aa 100644 --- a/src/commons/gitHubOverlay/FileExplorerDialog.tsx +++ b/src/commons/gitHubOverlay/FileExplorerDialog.tsx @@ -12,7 +12,6 @@ import { Octokit } from '@octokit/rest'; import { GetResponseTypeFromEndpointMethod } from '@octokit/types'; import classNames from 'classnames'; import React, { useEffect, useState } from 'react'; - import { checkIfFileCanBeOpened, checkIfFileCanBeSavedAndGetSaveType, @@ -21,7 +20,8 @@ import { openFileInEditor, performCreatingSave, performOverwritingSave -} from '../../features/github/GitHubUtils'; +} from 'src/features/github/GitHubUtils'; + import { GitHubFileNodeData } from './GitHubFileNodeData'; import { GitHubTreeNodeCreator } from './GitHubTreeNodeCreator'; diff --git a/src/commons/gitHubOverlay/GitHubTreeNodeCreator.tsx b/src/commons/gitHubOverlay/GitHubTreeNodeCreator.tsx index 0f87eaf4a7..c3bfe04c0c 100644 --- a/src/commons/gitHubOverlay/GitHubTreeNodeCreator.tsx +++ b/src/commons/gitHubOverlay/GitHubTreeNodeCreator.tsx @@ -1,7 +1,7 @@ import { TreeNodeInfo } from '@blueprintjs/core'; import { GetResponseTypeFromEndpointMethod } from '@octokit/types'; +import * as GitHubUtils from 'src/features/github/GitHubUtils'; -import * as GitHubUtils from '../../features/github/GitHubUtils'; import { GitHubFileNodeData } from './GitHubFileNodeData'; /** diff --git a/src/commons/gitHubOverlay/RepositoryDialog.tsx b/src/commons/gitHubOverlay/RepositoryDialog.tsx index 6139059d8a..bd46bbe16a 100644 --- a/src/commons/gitHubOverlay/RepositoryDialog.tsx +++ b/src/commons/gitHubOverlay/RepositoryDialog.tsx @@ -9,8 +9,7 @@ import { } from '@blueprintjs/core'; import classNames from 'classnames'; import React, { useState } from 'react'; - -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type RepositoryDialogProps = { userRepos: any[]; diff --git a/src/commons/githubAssessments/GitHubMissionCreateDialog.tsx b/src/commons/githubAssessments/GitHubMissionCreateDialog.tsx index 9f81e9038c..3ce4113c86 100644 --- a/src/commons/githubAssessments/GitHubMissionCreateDialog.tsx +++ b/src/commons/githubAssessments/GitHubMissionCreateDialog.tsx @@ -1,8 +1,7 @@ import { AnchorButton, Button, Classes, Dialog, InputGroup, Intent } from '@blueprintjs/core'; import classNames from 'classnames'; import React, { useState } from 'react'; - -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type GitHubMissionCreateDialogResolution = { confirmSave: boolean; diff --git a/src/commons/githubAssessments/GitHubMissionDataUtils.ts b/src/commons/githubAssessments/GitHubMissionDataUtils.ts index c6285e68bf..b8274075eb 100644 --- a/src/commons/githubAssessments/GitHubMissionDataUtils.ts +++ b/src/commons/githubAssessments/GitHubMissionDataUtils.ts @@ -5,9 +5,9 @@ import { } from '@octokit/types'; import { Chapter } from 'js-slang/dist/types'; import { isEqual } from 'lodash'; +import { IMCQQuestion, Testcase } from 'src/commons/assessment/AssessmentTypes'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; -import { IMCQQuestion, Testcase } from '../assessment/AssessmentTypes'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; import { MissionData, MissionMetadata, MissionRepoData, TaskData } from './GitHubMissionTypes'; export const maximumTasksPerMission = 20; diff --git a/src/commons/githubAssessments/GitHubMissionMobileLoginButton.tsx b/src/commons/githubAssessments/GitHubMissionMobileLoginButton.tsx index f94d7dc2c4..7f2b208a50 100644 --- a/src/commons/githubAssessments/GitHubMissionMobileLoginButton.tsx +++ b/src/commons/githubAssessments/GitHubMissionMobileLoginButton.tsx @@ -1,9 +1,8 @@ import { ButtonGroup } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - -import ControlButton from '../ControlButton'; -import { useResponsive, useTypedSelector } from '../utils/Hooks'; +import ControlButton from 'src/commons/ControlButton'; +import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; export type ControlBarGitHubMobileLoginButtonProps = { onClickLogIn: () => void; diff --git a/src/commons/githubAssessments/GitHubMissionTypes.ts b/src/commons/githubAssessments/GitHubMissionTypes.ts index 8bf8b0a284..0b16b99481 100644 --- a/src/commons/githubAssessments/GitHubMissionTypes.ts +++ b/src/commons/githubAssessments/GitHubMissionTypes.ts @@ -1,6 +1,5 @@ import { Chapter } from 'js-slang/dist/types'; - -import { Testcase } from '../assessment/AssessmentTypes'; +import { Testcase } from 'src/commons/assessment/AssessmentTypes'; /** * Represents a single task for a mission hosted in a GitHub repository. diff --git a/src/commons/mcqChooser/McqChooser.tsx b/src/commons/mcqChooser/McqChooser.tsx index 3e2d543f3b..6de2ebacc4 100644 --- a/src/commons/mcqChooser/McqChooser.tsx +++ b/src/commons/mcqChooser/McqChooser.tsx @@ -1,9 +1,11 @@ import { Button, Card, Intent } from '@blueprintjs/core'; import * as React from 'react'; - -import { IMCQQuestion } from '../assessment/AssessmentTypes'; -import Markdown from '../Markdown'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; +import { IMCQQuestion } from 'src/commons/assessment/AssessmentTypes'; +import Markdown from 'src/commons/Markdown'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; export type McqChooserProps = { mcq: IMCQQuestion; diff --git a/src/commons/missionCreator/MissionCreator.tsx b/src/commons/missionCreator/MissionCreator.tsx index 57250b6bb7..e08b878d04 100644 --- a/src/commons/missionCreator/MissionCreator.tsx +++ b/src/commons/missionCreator/MissionCreator.tsx @@ -1,21 +1,20 @@ import { FileInput } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; -import { parseString } from 'xml2js'; - import { Assessment, AssessmentOverview, assessmentTemplate, overviewTemplate -} from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; +} from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; import { makeEntireAssessment, retrieveLocalAssessment, storeLocalAssessment, storeLocalAssessmentOverview -} from '../XMLParser/XMLParserHelper'; +} from 'src/commons/XMLParser/XMLParserHelper'; +import { parseString } from 'xml2js'; type MissionCreatorProps = DispatchProps & OwnProps; diff --git a/src/commons/missionCreator/MissionCreatorContainer.ts b/src/commons/missionCreator/MissionCreatorContainer.ts index f6726f6411..0c2bbf7225 100644 --- a/src/commons/missionCreator/MissionCreatorContainer.ts +++ b/src/commons/missionCreator/MissionCreatorContainer.ts @@ -1,7 +1,7 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; +import { updateAssessment } from 'src/commons/application/actions/SessionActions'; -import { updateAssessment } from '../application/actions/SessionActions'; import MissionCreator, { DispatchProps } from './MissionCreator'; const mapStateToProps: MapStateToProps<{}, any, {}> = (state, ownProps) => ownProps; diff --git a/src/commons/mobileWorkspace/DraggableRepl.tsx b/src/commons/mobileWorkspace/DraggableRepl.tsx index 9f6d1bcd41..bf789c1673 100644 --- a/src/commons/mobileWorkspace/DraggableRepl.tsx +++ b/src/commons/mobileWorkspace/DraggableRepl.tsx @@ -1,7 +1,6 @@ import React from 'react'; import Draggable, { DraggableEventHandler } from 'react-draggable'; - -import Repl, { ReplProps } from '../repl/Repl'; +import Repl, { ReplProps } from 'src/commons/repl/Repl'; type DraggableReplProps = { position: { x: number; y: number }; diff --git a/src/commons/mobileWorkspace/MobileWorkspace.tsx b/src/commons/mobileWorkspace/MobileWorkspace.tsx index fc346aa534..9cb0fd1ea5 100644 --- a/src/commons/mobileWorkspace/MobileWorkspace.tsx +++ b/src/commons/mobileWorkspace/MobileWorkspace.tsx @@ -4,14 +4,14 @@ import { Ace } from 'ace-builds'; import React from 'react'; import { DraggableEvent } from 'react-draggable'; import { useMediaQuery } from 'react-responsive'; +import ControlBar from 'src/commons/controlBar/ControlBar'; +import EditorContainer, { EditorContainerProps } from 'src/commons/editor/EditorContainer'; +import McqChooser, { McqChooserProps } from 'src/commons/mcqChooser/McqChooser'; +import { Prompt } from 'src/commons/ReactRouterPrompt'; +import { ReplProps } from 'src/commons/repl/Repl'; +import { SideBarTab } from 'src/commons/sideBar/SideBar'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; -import ControlBar from '../controlBar/ControlBar'; -import EditorContainer, { EditorContainerProps } from '../editor/EditorContainer'; -import McqChooser, { McqChooserProps } from '../mcqChooser/McqChooser'; -import { Prompt } from '../ReactRouterPrompt'; -import { ReplProps } from '../repl/Repl'; -import { SideBarTab } from '../sideBar/SideBar'; -import { SideContentTab, SideContentType } from '../sideContent/SideContentTypes'; import DraggableRepl from './DraggableRepl'; import MobileKeyboard from './MobileKeyboard'; import MobileSideContent, { MobileSideContentProps } from './mobileSideContent/MobileSideContent'; diff --git a/src/commons/mobileWorkspace/mobileSideContent/MobileControlBar.tsx b/src/commons/mobileWorkspace/mobileSideContent/MobileControlBar.tsx index d58c818a09..d691b7d3a5 100644 --- a/src/commons/mobileWorkspace/mobileSideContent/MobileControlBar.tsx +++ b/src/commons/mobileWorkspace/mobileSideContent/MobileControlBar.tsx @@ -2,8 +2,7 @@ import { Button, Classes } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Popover2 } from '@blueprintjs/popover2'; import classNames from 'classnames'; - -import { ControlBarProps } from '../../controlBar/ControlBar'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; const MobileControlBar: React.FC = props => { const controlBarMenu = ( diff --git a/src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx b/src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx index 270beb9ac0..abdd1ae562 100644 --- a/src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx +++ b/src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx @@ -2,15 +2,15 @@ import { Classes, Icon, Tab, Tabs } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; import classNames from 'classnames'; import React from 'react'; - -import { ControlBarProps } from '../../controlBar/ControlBar'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; import GenericSideContent, { generateIconId, GenericSideContentProps -} from '../../sideContent/GenericSideContent'; -import { SideContentTab, SideContentType } from '../../sideContent/SideContentTypes'; -import { propsAreEqual } from '../../utils/MemoizeHelper'; -import { WorkspaceLocation } from '../../workspace/WorkspaceTypes'; +} from 'src/commons/sideContent/GenericSideContent'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { propsAreEqual } from 'src/commons/utils/MemoizeHelper'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; + import MobileControlBar from './MobileControlBar'; export type MobileSideContentProps = Omit & diff --git a/src/commons/mocks/AchievementMocks.ts b/src/commons/mocks/AchievementMocks.ts index 2c919c347b..c9ba2954c3 100644 --- a/src/commons/mocks/AchievementMocks.ts +++ b/src/commons/mocks/AchievementMocks.ts @@ -2,8 +2,8 @@ import { AchievementGoal, AchievementItem, GoalType -} from '../../features/achievement/AchievementTypes'; -import { AND, EventTypes } from '../../features/achievement/ExpressionTypes'; +} from 'src/features/achievement/AchievementTypes'; +import { AND, EventTypes } from 'src/features/achievement/ExpressionTypes'; export const mockAchievements: AchievementItem[] = [ { diff --git a/src/commons/mocks/AssessmentMocks.ts b/src/commons/mocks/AssessmentMocks.ts index c79600441c..6a262d7111 100644 --- a/src/commons/mocks/AssessmentMocks.ts +++ b/src/commons/mocks/AssessmentMocks.ts @@ -1,6 +1,5 @@ import { Chapter } from 'js-slang/dist/types'; - -import { ExternalLibraryName } from '../application/types/ExternalTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { Assessment, AssessmentConfiguration, @@ -12,7 +11,7 @@ import { IProgrammingQuestion, Library, TestcaseTypes -} from '../assessment/AssessmentTypes'; +} from 'src/commons/assessment/AssessmentTypes'; export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [ [ diff --git a/src/commons/mocks/BackendMocks.ts b/src/commons/mocks/BackendMocks.ts index 0d027e84cb..48a81c5eca 100644 --- a/src/commons/mocks/BackendMocks.ts +++ b/src/commons/mocks/BackendMocks.ts @@ -1,15 +1,12 @@ import { SagaIterator } from 'redux-saga'; import { call, put, select, takeEvery } from 'redux-saga/effects'; - -import { FETCH_GROUP_GRADING_SUMMARY } from '../../features/dashboard/DashboardTypes'; -import { Grading, GradingOverview, GradingQuestion } from '../../features/grading/GradingTypes'; import { OverallState, Role, SALanguage, styliseSublanguage, SupportedLanguage -} from '../application/ApplicationTypes'; +} from 'src/commons/application/ApplicationTypes'; import { ACKNOWLEDGE_NOTIFICATIONS, AdminPanelCourseRegistration, @@ -29,22 +26,28 @@ import { UPDATE_ASSESSMENT_CONFIGS, UPDATE_COURSE_CONFIG, UPDATE_LATEST_VIEWED_COURSE -} from '../application/types/SessionTypes'; +} from 'src/commons/application/types/SessionTypes'; import { AssessmentOverview, AssessmentStatuses, FETCH_ASSESSMENT_OVERVIEWS, Question, SUBMIT_ASSESSMENT -} from '../assessment/AssessmentTypes'; +} from 'src/commons/assessment/AssessmentTypes'; import { Notification, NotificationFilterFunction -} from '../notificationBadge/NotificationBadgeTypes'; -import { routerNavigate } from '../sagas/BackendSaga'; -import { actions } from '../utils/ActionsHelper'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; +} from 'src/commons/notificationBadge/NotificationBadgeTypes'; +import { routerNavigate } from 'src/commons/sagas/BackendSaga'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { FETCH_GROUP_GRADING_SUMMARY } from 'src/features/dashboard/DashboardTypes'; +import { Grading, GradingOverview, GradingQuestion } from 'src/features/grading/GradingTypes'; + import { mockAssessmentConfigurations, mockAssessmentOverviews, diff --git a/src/commons/mocks/GradingMocks.ts b/src/commons/mocks/GradingMocks.ts index a634679582..49862cfa02 100644 --- a/src/commons/mocks/GradingMocks.ts +++ b/src/commons/mocks/GradingMocks.ts @@ -1,7 +1,8 @@ -import { GradingSummary } from '../../features/dashboard/DashboardTypes'; -import { Grading, GradingOverview } from '../../features/grading/GradingTypes'; -import { Role } from '../application/ApplicationTypes'; -import { Testcase, TestcaseTypes } from '../assessment/AssessmentTypes'; +import { Role } from 'src/commons/application/ApplicationTypes'; +import { Testcase, TestcaseTypes } from 'src/commons/assessment/AssessmentTypes'; +import { GradingSummary } from 'src/features/dashboard/DashboardTypes'; +import { Grading, GradingOverview } from 'src/features/grading/GradingTypes'; + import { mockLibrary } from './AssessmentMocks'; import { mockFetchRole } from './UserMocks'; diff --git a/src/commons/mocks/StoreMocks.ts b/src/commons/mocks/StoreMocks.ts index aa166b5319..218d86f145 100644 --- a/src/commons/mocks/StoreMocks.ts +++ b/src/commons/mocks/StoreMocks.ts @@ -1,7 +1,6 @@ import _ from 'lodash'; import { DeepPartial, Store } from 'redux'; import mockStore from 'redux-mock-store'; - import { defaultAcademy, defaultAchievement, @@ -14,7 +13,7 @@ import { defaultStories, defaultWorkspaceManager, OverallState -} from '../application/ApplicationTypes'; +} from 'src/commons/application/ApplicationTypes'; export function mockInitialStore(overrides?: DeepPartial): Store { const createStore = (mockStore as any)(); diff --git a/src/commons/mocks/UserMocks.ts b/src/commons/mocks/UserMocks.ts index 35b1737da0..3cd7f5244a 100644 --- a/src/commons/mocks/UserMocks.ts +++ b/src/commons/mocks/UserMocks.ts @@ -1,13 +1,15 @@ import { Chapter, Variant } from 'js-slang/dist/types'; - -import { GameState, Role } from '../application/ApplicationTypes'; +import { GameState, Role } from 'src/commons/application/ApplicationTypes'; import { AdminPanelCourseRegistration, CourseConfiguration, CourseRegistration, User -} from '../application/types/SessionTypes'; -import { Notification, NotificationTypes } from '../notificationBadge/NotificationBadgeTypes'; +} from 'src/commons/application/types/SessionTypes'; +import { + Notification, + NotificationTypes +} from 'src/commons/notificationBadge/NotificationBadgeTypes'; /** * Mock for fetching a role, given an access token. A null diff --git a/src/commons/navigationBar/NavigationBar.tsx b/src/commons/navigationBar/NavigationBar.tsx index 1ad361a2b7..470a1a4671 100644 --- a/src/commons/navigationBar/NavigationBar.tsx +++ b/src/commons/navigationBar/NavigationBar.tsx @@ -18,12 +18,12 @@ import classNames from 'classnames'; import { Location } from 'history'; import { useCallback, useMemo, useState } from 'react'; import { NavLink, Route, Routes, useLocation } from 'react-router-dom'; +import Dropdown from 'src/commons/dropdown/Dropdown'; +import NotificationBadge from 'src/commons/notificationBadge/NotificationBadge'; +import { filterNotificationsByType } from 'src/commons/notificationBadge/NotificationBadgeHelper'; +import Constants from 'src/commons/utils/Constants'; +import { useResponsive, useSession } from 'src/commons/utils/Hooks'; -import Dropdown from '../dropdown/Dropdown'; -import NotificationBadge from '../notificationBadge/NotificationBadge'; -import { filterNotificationsByType } from '../notificationBadge/NotificationBadgeHelper'; -import Constants from '../utils/Constants'; -import { useResponsive, useSession } from '../utils/Hooks'; import AcademyNavigationBar, { assessmentTypesToNavlinkInfo, getAcademyNavbarRightInfo diff --git a/src/commons/navigationBar/subcomponents/AcademyNavigationBar.tsx b/src/commons/navigationBar/subcomponents/AcademyNavigationBar.tsx index e419650cd5..e14fe37a51 100644 --- a/src/commons/navigationBar/subcomponents/AcademyNavigationBar.tsx +++ b/src/commons/navigationBar/subcomponents/AcademyNavigationBar.tsx @@ -1,13 +1,16 @@ import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core'; import { IconName, IconNames } from '@blueprintjs/icons'; import * as React from 'react'; +import { Role } from 'src/commons/application/ApplicationTypes'; import { AssessmentType } from 'src/commons/assessment/AssessmentTypes'; +import { + createDesktopNavlink, + NavbarEntryInfo, + renderNavlinksFromInfo +} from 'src/commons/navigationBar/NavigationBar'; import { useTypedSelector } from 'src/commons/utils/Hooks'; import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; -import { Role } from '../../application/ApplicationTypes'; -import { createDesktopNavlink, NavbarEntryInfo, renderNavlinksFromInfo } from '../NavigationBar'; - type OwnProps = { assessmentTypes?: AssessmentType[]; }; diff --git a/src/commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar.tsx b/src/commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar.tsx index c8f82c8064..3b54c4775f 100644 --- a/src/commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar.tsx +++ b/src/commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar.tsx @@ -15,10 +15,9 @@ import { Octokit } from '@octokit/rest'; import classNames from 'classnames'; import * as React from 'react'; import { NavLink } from 'react-router-dom'; - -import { GHAssessmentTypeOverview } from '../../../pages/githubAssessments/GitHubClassroom'; -import { ControlBarGitHubLoginButton } from '../../controlBar/github/ControlBarGitHubLoginButton'; -import { assessmentTypeLink } from '../../utils/ParamParseHelper'; +import { ControlBarGitHubLoginButton } from 'src/commons/controlBar/github/ControlBarGitHubLoginButton'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; +import { GHAssessmentTypeOverview } from 'src/pages/githubAssessments/GitHubClassroom'; type GitHubAssessmentsNavigationBarProps = DispatchProps & StateProps; diff --git a/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx b/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx index dd0c686fe3..2d2da949b7 100644 --- a/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx +++ b/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx @@ -5,10 +5,9 @@ import * as React from 'react'; import { useNavigate, useParams } from 'react-router'; import ControlButton from 'src/commons/ControlButton'; import Constants from 'src/commons/utils/Constants'; +import { TableOfContentsButton } from 'src/features/sicp/TableOfContentsButton'; import { getNext, getPrev } from 'src/features/sicp/TableOfContentsHelper'; - -import { TableOfContentsButton } from '../../../features/sicp/TableOfContentsButton'; -import SicpToc from '../../../pages/sicp/subcomponents/SicpToc'; +import SicpToc from 'src/pages/sicp/subcomponents/SicpToc'; /** * Secondary navbar for SICP, should only be displayed when on pages related to interactive /SICP. diff --git a/src/commons/notificationBadge/NotificationBadge.tsx b/src/commons/notificationBadge/NotificationBadge.tsx index 764ec1c601..7e4aaa9d6b 100644 --- a/src/commons/notificationBadge/NotificationBadge.tsx +++ b/src/commons/notificationBadge/NotificationBadge.tsx @@ -2,9 +2,9 @@ import { Intent, PopoverInteractionKind, Position, Tag } from '@blueprintjs/core import { Popover2 } from '@blueprintjs/popover2'; import React from 'react'; import { useDispatch } from 'react-redux'; +import { acknowledgeNotifications } from 'src/commons/application/actions/SessionActions'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; -import { acknowledgeNotifications } from '../application/actions/SessionActions'; -import { useTypedSelector } from '../utils/Hooks'; import { filterNotificationsById } from './NotificationBadgeHelper'; import { Notification, NotificationType, NotificationTypes } from './NotificationBadgeTypes'; diff --git a/src/commons/notificationBadge/NotificationBadgeHelper.ts b/src/commons/notificationBadge/NotificationBadgeHelper.ts index a166fe6c64..1c2bfd1302 100644 --- a/src/commons/notificationBadge/NotificationBadgeHelper.ts +++ b/src/commons/notificationBadge/NotificationBadgeHelper.ts @@ -1,4 +1,5 @@ -import { AssessmentType } from '../assessment/AssessmentTypes'; +import { AssessmentType } from 'src/commons/assessment/AssessmentTypes'; + import { Notification, NotificationFilterFunction } from './NotificationBadgeTypes'; /** diff --git a/src/commons/profile/Profile.tsx b/src/commons/profile/Profile.tsx index 6fd1dda073..ca4ab47c22 100644 --- a/src/commons/profile/Profile.tsx +++ b/src/commons/profile/Profile.tsx @@ -2,11 +2,18 @@ import { Drawer, DrawerSize, NonIdealState, Spinner } from '@blueprintjs/core'; import { IconName, IconNames } from '@blueprintjs/icons'; import React, { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; +import { + fetchAssessmentOverviews, + fetchTotalXp +} from 'src/commons/application/actions/SessionActions'; +import { + AssessmentStatuses, + AssessmentType, + GradingStatuses +} from 'src/commons/assessment/AssessmentTypes'; +import Constants from 'src/commons/utils/Constants'; +import { useSession } from 'src/commons/utils/Hooks'; -import { fetchAssessmentOverviews, fetchTotalXp } from '../application/actions/SessionActions'; -import { AssessmentStatuses, AssessmentType, GradingStatuses } from '../assessment/AssessmentTypes'; -import Constants from '../utils/Constants'; -import { useSession } from '../utils/Hooks'; import ProfileCard from './ProfileCard'; export type ProfileProps = OwnProps; diff --git a/src/commons/profile/ProfileCard.tsx b/src/commons/profile/ProfileCard.tsx index cd722900a7..4b1d2a1e3a 100644 --- a/src/commons/profile/ProfileCard.tsx +++ b/src/commons/profile/ProfileCard.tsx @@ -2,9 +2,8 @@ import { Callout, ProgressBar } from '@blueprintjs/core'; import { IconName } from '@blueprintjs/icons'; import React from 'react'; import { NavLink } from 'react-router-dom'; - -import { AssessmentOverview, AssessmentType } from '../assessment/AssessmentTypes'; -import { assessmentTypeLink } from '../utils/ParamParseHelper'; +import { AssessmentOverview, AssessmentType } from 'src/commons/assessment/AssessmentTypes'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; type ProfileCardProps = DispatchProps & StateProps; diff --git a/src/commons/repl/Repl.tsx b/src/commons/repl/Repl.tsx index acf1588770..d61c262787 100644 --- a/src/commons/repl/Repl.tsx +++ b/src/commons/repl/Repl.tsx @@ -5,9 +5,9 @@ import { parseError } from 'js-slang'; import { Chapter, Variant } from 'js-slang/dist/types'; import * as React from 'react'; import { HotKeys } from 'react-hotkeys'; +import { InterpreterOutput } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; -import { InterpreterOutput } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; import { ReplInput } from './ReplInput'; import { OutputProps } from './ReplTypes'; diff --git a/src/commons/repl/ReplInput.tsx b/src/commons/repl/ReplInput.tsx index 28db848edc..0ba193234a 100644 --- a/src/commons/repl/ReplInput.tsx +++ b/src/commons/repl/ReplInput.tsx @@ -6,9 +6,8 @@ import * as React from 'react'; import AceEditor from 'react-ace'; import ReactAce from 'react-ace/lib/ace'; import MediaQuery from 'react-responsive'; - -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { getModeString, selectMode } from '../utils/AceHelper'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { getModeString, selectMode } from 'src/commons/utils/AceHelper'; // source mode and chapter imported in Editor.tsx export type ReplInputProps = DispatchProps & StateProps & OwnProps; diff --git a/src/commons/repl/ReplTypes.ts b/src/commons/repl/ReplTypes.ts index cb427781dd..e93aaf5010 100644 --- a/src/commons/repl/ReplTypes.ts +++ b/src/commons/repl/ReplTypes.ts @@ -1,4 +1,4 @@ -import { InterpreterOutput } from '../application/ApplicationTypes'; +import { InterpreterOutput } from 'src/commons/application/ApplicationTypes'; export type OutputProps = { output: InterpreterOutput; diff --git a/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx b/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx index 9ed531d41e..4344db2a95 100644 --- a/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx +++ b/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx @@ -1,8 +1,7 @@ import { Button, Classes, Dialog, H4, Intent } from '@blueprintjs/core'; import { useDispatch } from 'react-redux'; - -import { updateCourseResearchAgreement } from '../application/actions/SessionActions'; -import Constants from '../utils/Constants'; +import { updateCourseResearchAgreement } from 'src/commons/application/actions/SessionActions'; +import Constants from 'src/commons/utils/Constants'; const ResearchAgreementPrompt: React.FC = () => { const dispatch = useDispatch(); diff --git a/src/commons/sagas/AchievementSaga.ts b/src/commons/sagas/AchievementSaga.ts index 0d712d9d0a..9bd1fff2b8 100644 --- a/src/commons/sagas/AchievementSaga.ts +++ b/src/commons/sagas/AchievementSaga.ts @@ -1,6 +1,13 @@ import { SagaIterator } from 'redux-saga'; import { call, delay, put, select } from 'redux-saga/effects'; - +import { updateGoalProcessed } from 'src/commons/achievement/AchievementManualEditor'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import { goalIncludesEvents, incrementCount } from 'src/commons/achievement/utils/EventHandler'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { Tokens } from 'src/commons/application/types/SessionTypes'; +import { SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import Constants from 'src/commons/utils/Constants'; import { AchievementGoal, ADD_EVENT, @@ -17,15 +24,8 @@ import { REMOVE_GOAL, UPDATE_GOAL_PROGRESS, UPDATE_OWN_GOAL_PROGRESS -} from '../../features/achievement/AchievementTypes'; -import { updateGoalProcessed } from '../achievement/AchievementManualEditor'; -import AchievementInferencer from '../achievement/utils/AchievementInferencer'; -import { goalIncludesEvents, incrementCount } from '../achievement/utils/EventHandler'; -import { OverallState } from '../application/ApplicationTypes'; -import { Tokens } from '../application/types/SessionTypes'; -import { SideContentType } from '../sideContent/SideContentTypes'; -import { actions } from '../utils/ActionsHelper'; -import Constants from '../utils/Constants'; +} from 'src/features/achievement/AchievementTypes'; + import { bulkUpdateAchievements, bulkUpdateGoals, diff --git a/src/commons/sagas/BackendSaga.ts b/src/commons/sagas/BackendSaga.ts index 461ee6837f..6c17494188 100644 --- a/src/commons/sagas/BackendSaga.ts +++ b/src/commons/sagas/BackendSaga.ts @@ -2,28 +2,8 @@ /*eslint-env browser*/ import { SagaIterator } from 'redux-saga'; import { call, put, select } from 'redux-saga/effects'; -import { ADD_NEW_USERS_TO_COURSE, CREATE_COURSE } from 'src/features/academy/AcademyTypes'; -import { UsernameRoleGroup } from 'src/pages/academy/adminPanel/subcomponents/AddUserPanel'; - -import { - FETCH_GROUP_GRADING_SUMMARY, - GradingSummary -} from '../../features/dashboard/DashboardTypes'; -import { Grading, GradingOverview, GradingQuestion } from '../../features/grading/GradingTypes'; -import { - CHANGE_DATE_ASSESSMENT, - DELETE_ASSESSMENT, - PUBLISH_ASSESSMENT, - UPLOAD_ASSESSMENT -} from '../../features/groundControl/GroundControlTypes'; -import { FETCH_SOURCECAST_INDEX } from '../../features/sourceRecorder/sourcecast/SourcecastTypes'; -import { - SAVE_SOURCECAST_DATA, - SourcecastData -} from '../../features/sourceRecorder/SourceRecorderTypes'; -import { DELETE_SOURCECAST_ENTRY } from '../../features/sourceRecorder/sourcereel/SourcereelTypes'; -import { OverallState, Role } from '../application/ApplicationTypes'; -import { RouterState } from '../application/types/CommonsTypes'; +import { OverallState, Role } from 'src/commons/application/ApplicationTypes'; +import { RouterState } from 'src/commons/application/types/CommonsTypes'; import { ACKNOWLEDGE_NOTIFICATIONS, AdminPanelCourseRegistration, @@ -66,7 +46,7 @@ import { UPDATE_USER_ROLE, UpdateCourseConfiguration, User -} from '../application/types/SessionTypes'; +} from 'src/commons/application/types/SessionTypes'; import { Assessment, AssessmentConfiguration, @@ -75,15 +55,35 @@ import { FETCH_ASSESSMENT_OVERVIEWS, Question, SUBMIT_ASSESSMENT -} from '../assessment/AssessmentTypes'; +} from 'src/commons/assessment/AssessmentTypes'; import { Notification, NotificationFilterFunction -} from '../notificationBadge/NotificationBadgeTypes'; -import { actions } from '../utils/ActionsHelper'; -import { computeRedirectUri, getClientId, getDefaultProvider } from '../utils/AuthHelper'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { CHANGE_SUBLANGUAGE, WorkspaceLocation } from '../workspace/WorkspaceTypes'; +} from 'src/commons/notificationBadge/NotificationBadgeTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { computeRedirectUri, getClientId, getDefaultProvider } from 'src/commons/utils/AuthHelper'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { CHANGE_SUBLANGUAGE, WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { ADD_NEW_USERS_TO_COURSE, CREATE_COURSE } from 'src/features/academy/AcademyTypes'; +import { FETCH_GROUP_GRADING_SUMMARY, GradingSummary } from 'src/features/dashboard/DashboardTypes'; +import { Grading, GradingOverview, GradingQuestion } from 'src/features/grading/GradingTypes'; +import { + CHANGE_DATE_ASSESSMENT, + DELETE_ASSESSMENT, + PUBLISH_ASSESSMENT, + UPLOAD_ASSESSMENT +} from 'src/features/groundControl/GroundControlTypes'; +import { FETCH_SOURCECAST_INDEX } from 'src/features/sourceRecorder/sourcecast/SourcecastTypes'; +import { + SAVE_SOURCECAST_DATA, + SourcecastData +} from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { DELETE_SOURCECAST_ENTRY } from 'src/features/sourceRecorder/sourcereel/SourcereelTypes'; +import { UsernameRoleGroup } from 'src/pages/academy/adminPanel/subcomponents/AddUserPanel'; + import { deleteAssessment, deleteSourcecastEntry, diff --git a/src/commons/sagas/GitHubPersistenceSaga.ts b/src/commons/sagas/GitHubPersistenceSaga.ts index 84b96f1173..ea3e698195 100644 --- a/src/commons/sagas/GitHubPersistenceSaga.ts +++ b/src/commons/sagas/GitHubPersistenceSaga.ts @@ -4,24 +4,30 @@ import { } from '@octokit/types'; import { SagaIterator } from 'redux-saga'; import { call, put, select, takeLatest } from 'redux-saga/effects'; - +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { LOGIN_GITHUB, LOGOUT_GITHUB } from 'src/commons/application/types/SessionTypes'; +import FileExplorerDialog, { + FileExplorerDialogProps +} from 'src/commons/gitHubOverlay/FileExplorerDialog'; +import RepositoryDialog, { + RepositoryDialogProps +} from 'src/commons/gitHubOverlay/RepositoryDialog'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import Constants from 'src/commons/utils/Constants'; +import { promisifyDialog } from 'src/commons/utils/DialogHelper'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { EditorTabState } from 'src/commons/workspace/WorkspaceTypes'; import { GITHUB_OPEN_FILE, GITHUB_SAVE_FILE, GITHUB_SAVE_FILE_AS -} from '../../features/github/GitHubTypes'; -import * as GitHubUtils from '../../features/github/GitHubUtils'; -import { getGitHubOctokitInstance } from '../../features/github/GitHubUtils'; -import { store } from '../../pages/createStore'; -import { OverallState } from '../application/ApplicationTypes'; -import { LOGIN_GITHUB, LOGOUT_GITHUB } from '../application/types/SessionTypes'; -import FileExplorerDialog, { FileExplorerDialogProps } from '../gitHubOverlay/FileExplorerDialog'; -import RepositoryDialog, { RepositoryDialogProps } from '../gitHubOverlay/RepositoryDialog'; -import { actions } from '../utils/ActionsHelper'; -import Constants from '../utils/Constants'; -import { promisifyDialog } from '../utils/DialogHelper'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { EditorTabState } from '../workspace/WorkspaceTypes'; +} from 'src/features/github/GitHubTypes'; +import * as GitHubUtils from 'src/features/github/GitHubUtils'; +import { getGitHubOctokitInstance } from 'src/features/github/GitHubUtils'; +import { store } from 'src/pages/createStore'; export function* GitHubPersistenceSaga(): SagaIterator { yield takeLatest(LOGIN_GITHUB, githubLoginSaga); diff --git a/src/commons/sagas/LoginSaga.ts b/src/commons/sagas/LoginSaga.ts index aa68a1a174..5fdcdcd586 100644 --- a/src/commons/sagas/LoginSaga.ts +++ b/src/commons/sagas/LoginSaga.ts @@ -1,12 +1,12 @@ import * as Sentry from '@sentry/browser'; import { SagaIterator } from 'redux-saga'; import { call } from 'redux-saga/effects'; +import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; +import { LOGIN, SET_USER } from 'src/commons/application/types/SessionTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { computeEndpointUrl } from 'src/commons/utils/AuthHelper'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; -import { LOG_OUT } from '../application/types/CommonsTypes'; -import { LOGIN, SET_USER } from '../application/types/SessionTypes'; -import { actions } from '../utils/ActionsHelper'; -import { computeEndpointUrl } from '../utils/AuthHelper'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; import { safeTakeEvery as takeEvery } from './SafeEffects'; export default function* LoginSaga(): SagaIterator { diff --git a/src/commons/sagas/MainSaga.ts b/src/commons/sagas/MainSaga.ts index cc7aaaf616..9e06926533 100644 --- a/src/commons/sagas/MainSaga.ts +++ b/src/commons/sagas/MainSaga.ts @@ -1,8 +1,8 @@ import { SagaIterator } from 'redux-saga'; import { fork } from 'redux-saga/effects'; +import { mockBackendSaga } from 'src/commons/mocks/BackendMocks'; +import Constants from 'src/commons/utils/Constants'; -import { mockBackendSaga } from '../mocks/BackendMocks'; -import Constants from '../utils/Constants'; import AchievementSaga from './AchievementSaga'; import BackendSaga from './BackendSaga'; import GitHubPersistenceSaga from './GitHubPersistenceSaga'; diff --git a/src/commons/sagas/PersistenceSaga.tsx b/src/commons/sagas/PersistenceSaga.tsx index e87e2f923d..5e7eac503e 100644 --- a/src/commons/sagas/PersistenceSaga.tsx +++ b/src/commons/sagas/PersistenceSaga.tsx @@ -2,28 +2,28 @@ import { Intent } from '@blueprintjs/core'; import { Chapter, Variant } from 'js-slang/dist/types'; import { SagaIterator } from 'redux-saga'; import { call, put, select } from 'redux-saga/effects'; - +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { LOGOUT_GOOGLE } from 'src/commons/application/types/SessionTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import Constants from 'src/commons/utils/Constants'; +import { showSimpleConfirmDialog, showSimplePromptDialog } from 'src/commons/utils/DialogHelper'; +import { + dismiss, + showMessage, + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { AsyncReturnType } from 'src/commons/utils/TypeHelper'; import { PERSISTENCE_INITIALISE, PERSISTENCE_OPEN_PICKER, PERSISTENCE_SAVE_FILE, PERSISTENCE_SAVE_FILE_AS, PersistenceFile -} from '../../features/persistence/PersistenceTypes'; -import { store } from '../../pages/createStore'; -import { OverallState } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { LOGOUT_GOOGLE } from '../application/types/SessionTypes'; -import { actions } from '../utils/ActionsHelper'; -import Constants from '../utils/Constants'; -import { showSimpleConfirmDialog, showSimplePromptDialog } from '../utils/DialogHelper'; -import { - dismiss, - showMessage, - showSuccessMessage, - showWarningMessage -} from '../utils/notifications/NotificationsHelper'; -import { AsyncReturnType } from '../utils/TypeHelper'; +} from 'src/features/persistence/PersistenceTypes'; +import { store } from 'src/pages/createStore'; + import { safeTakeEvery as takeEvery, safeTakeLatest as takeLatest } from './SafeEffects'; const DISCOVERY_DOCS = ['https://www.googleapis.com/discovery/v1/apis/drive/v3/rest']; diff --git a/src/commons/sagas/PlaygroundSaga.ts b/src/commons/sagas/PlaygroundSaga.ts index 1f21129a0c..8465bf583e 100644 --- a/src/commons/sagas/PlaygroundSaga.ts +++ b/src/commons/sagas/PlaygroundSaga.ts @@ -4,19 +4,22 @@ import { compressToEncodedURIComponent } from 'lz-string'; import * as qs from 'query-string'; import { SagaIterator } from 'redux-saga'; import { call, delay, put, race, select } from 'redux-saga/effects'; - +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { retrieveFilesInWorkspaceAsRecord } from 'src/commons/fileSystem/utils'; +import Constants from 'src/commons/utils/Constants'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { EditorTabState } from 'src/commons/workspace/WorkspaceTypes'; import { changeQueryString, shortenURL, updateShortURL -} from '../../features/playground/PlaygroundActions'; -import { GENERATE_LZ_STRING, SHORTEN_URL } from '../../features/playground/PlaygroundTypes'; -import { OverallState } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { retrieveFilesInWorkspaceAsRecord } from '../fileSystem/utils'; -import Constants from '../utils/Constants'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { EditorTabState } from '../workspace/WorkspaceTypes'; +} from 'src/features/playground/PlaygroundActions'; +import { GENERATE_LZ_STRING, SHORTEN_URL } from 'src/features/playground/PlaygroundTypes'; + import { safeTakeEvery as takeEvery } from './SafeEffects'; export default function* PlaygroundSaga(): SagaIterator { diff --git a/src/commons/sagas/RemoteExecutionSaga.ts b/src/commons/sagas/RemoteExecutionSaga.ts index 57b69bd684..3cda24fc6c 100644 --- a/src/commons/sagas/RemoteExecutionSaga.ts +++ b/src/commons/sagas/RemoteExecutionSaga.ts @@ -5,6 +5,11 @@ import { Chapter, Variant } from 'js-slang/dist/types'; import _ from 'lodash'; import { SagaIterator } from 'redux-saga'; import { call, put, race, select, take } from 'redux-saga/effects'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { BEGIN_INTERRUPT_EXECUTION } from 'src/commons/application/types/InterpreterTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { MaybePromise } from 'src/commons/utils/TypeHelper'; import { Ev3DevicePeripherals, Ev3MotorData, @@ -24,11 +29,6 @@ import { } from 'src/features/remoteExecution/RemoteExecutionTypes'; import { store } from 'src/pages/createStore'; -import { OverallState } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { BEGIN_INTERRUPT_EXECUTION } from '../application/types/InterpreterTypes'; -import { actions } from '../utils/ActionsHelper'; -import { MaybePromise } from '../utils/TypeHelper'; import { fetchDevices, getDeviceWSEndpoint } from './RequestsSaga'; import { safeTakeEvery as takeEvery, safeTakeLatest as takeLatest } from './SafeEffects'; diff --git a/src/commons/sagas/RequestsSaga.ts b/src/commons/sagas/RequestsSaga.ts index 040d5b51bd..0974756b3a 100644 --- a/src/commons/sagas/RequestsSaga.ts +++ b/src/commons/sagas/RequestsSaga.ts @@ -1,29 +1,12 @@ import { call } from 'redux-saga/effects'; - -import { - AchievementGoal, - AchievementItem, - AchievementUser, - GoalDefinition, - GoalProgress -} from '../../features/achievement/AchievementTypes'; -import { GradingSummary } from '../../features/dashboard/DashboardTypes'; -import { Grading, GradingOverview, GradingQuestion } from '../../features/grading/GradingTypes'; -import { - Device, - WebSocketEndpointInformation -} from '../../features/remoteExecution/RemoteExecutionTypes'; -import { PlaybackData, SourcecastData } from '../../features/sourceRecorder/SourceRecorderTypes'; -import { UsernameRoleGroup } from '../../pages/academy/adminPanel/subcomponents/AddUserPanel'; -import { store } from '../../pages/createStore'; import { backendifyAchievementItem, backendifyGoalDefinition, frontendifyAchievementGoal, frontendifyAchievementItem -} from '../achievement/utils/AchievementBackender'; -import { Role } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; +} from 'src/commons/achievement/utils/AchievementBackender'; +import { Role } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { AdminPanelCourseRegistration, CourseConfiguration, @@ -34,7 +17,7 @@ import { Tokens, UpdateCourseConfiguration, User -} from '../application/types/SessionTypes'; +} from 'src/commons/application/types/SessionTypes'; import { Assessment, AssessmentConfiguration, @@ -45,11 +28,27 @@ import { IProgrammingQuestion, QuestionType, QuestionTypes -} from '../assessment/AssessmentTypes'; -import { Notification } from '../notificationBadge/NotificationBadgeTypes'; -import { castLibrary } from '../utils/CastBackend'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { request } from '../utils/RequestHelper'; +} from 'src/commons/assessment/AssessmentTypes'; +import { Notification } from 'src/commons/notificationBadge/NotificationBadgeTypes'; +import { castLibrary } from 'src/commons/utils/CastBackend'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { request } from 'src/commons/utils/RequestHelper'; +import { + AchievementGoal, + AchievementItem, + AchievementUser, + GoalDefinition, + GoalProgress +} from 'src/features/achievement/AchievementTypes'; +import { GradingSummary } from 'src/features/dashboard/DashboardTypes'; +import { Grading, GradingOverview, GradingQuestion } from 'src/features/grading/GradingTypes'; +import { + Device, + WebSocketEndpointInformation +} from 'src/features/remoteExecution/RemoteExecutionTypes'; +import { PlaybackData, SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { UsernameRoleGroup } from 'src/pages/academy/adminPanel/subcomponents/AddUserPanel'; +import { store } from 'src/pages/createStore'; /** * POST /auth/login diff --git a/src/commons/sagas/StoriesSaga.ts b/src/commons/sagas/StoriesSaga.ts index 67696b7e53..d3dbbffa57 100644 --- a/src/commons/sagas/StoriesSaga.ts +++ b/src/commons/sagas/StoriesSaga.ts @@ -1,5 +1,10 @@ import { SagaIterator } from 'redux-saga'; import { call, put, select, takeLatest } from 'redux-saga/effects'; +import { OverallState, StoriesRole } from 'src/commons/application/ApplicationTypes'; +import { Tokens } from 'src/commons/application/types/SessionTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { defaultStoryContent } from 'src/commons/utils/StoriesHelper'; import { ADD_NEW_STORIES_USERS_TO_COURSE } from 'src/features/academy/AcademyTypes'; import { deleteStory, @@ -22,11 +27,6 @@ import { StoryView } from 'src/features/stories/StoriesTypes'; -import { OverallState, StoriesRole } from '../application/ApplicationTypes'; -import { Tokens } from '../application/types/SessionTypes'; -import { actions } from '../utils/ActionsHelper'; -import { showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { defaultStoryContent } from '../utils/StoriesHelper'; import { selectTokens } from './BackendSaga'; import { safeTakeEvery as takeEvery } from './SafeEffects'; diff --git a/src/commons/sagas/WorkspaceSaga.ts b/src/commons/sagas/WorkspaceSaga.ts index 0669a79063..21fdbb3581 100644 --- a/src/commons/sagas/WorkspaceSaga.ts +++ b/src/commons/sagas/WorkspaceSaga.ts @@ -23,21 +23,16 @@ import Phaser from 'phaser'; import { SagaIterator } from 'redux-saga'; import { call, put, race, select, StrictEffect, take } from 'redux-saga/effects'; import * as Sourceror from 'sourceror'; -import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; -import { notifyStoriesEvaluated } from 'src/features/stories/StoriesActions'; -import { EVAL_STORY } from 'src/features/stories/StoriesTypes'; - -import { EventType } from '../../features/achievement/AchievementTypes'; -import DataVisualizer from '../../features/dataVisualizer/dataVisualizer'; -import { DeviceSession } from '../../features/remoteExecution/RemoteExecutionTypes'; -import { WORKSPACE_BASE_PATHS } from '../../pages/fileSystem/createInBrowserFileSystem'; import { defaultEditorValue, isSourceLanguage, OverallState, styliseSublanguage -} from '../application/ApplicationTypes'; -import { externalLibraries, ExternalLibraryName } from '../application/types/ExternalTypes'; +} from 'src/commons/application/ApplicationTypes'; +import { + externalLibraries, + ExternalLibraryName +} from 'src/commons/application/types/ExternalTypes'; import { BEGIN_DEBUG_PAUSE, BEGIN_INTERRUPT_EXECUTION, @@ -45,13 +40,21 @@ import { DEBUG_RESUME, UPDATE_EDITOR_HIGHLIGHTED_LINES, UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA -} from '../application/types/InterpreterTypes'; -import { Library, Testcase, TestcaseType, TestcaseTypes } from '../assessment/AssessmentTypes'; -import { Documentation } from '../documentation/Documentation'; -import { retrieveFilesInWorkspaceAsRecord, writeFileRecursively } from '../fileSystem/utils'; -import { SideContentType } from '../sideContent/SideContentTypes'; -import { actions } from '../utils/ActionsHelper'; -import DisplayBufferService from '../utils/DisplayBufferService'; +} from 'src/commons/application/types/InterpreterTypes'; +import { + Library, + Testcase, + TestcaseType, + TestcaseTypes +} from 'src/commons/assessment/AssessmentTypes'; +import { Documentation } from 'src/commons/documentation/Documentation'; +import { + retrieveFilesInWorkspaceAsRecord, + writeFileRecursively +} from 'src/commons/fileSystem/utils'; +import { SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import DisplayBufferService from 'src/commons/utils/DisplayBufferService'; import { getBlockExtraMethodsString, getDifferenceInMethods, @@ -63,11 +66,14 @@ import { highlightLineForAgenda, makeElevatedContext, visualizeEnv -} from '../utils/JsSlangHelper'; -import { showSuccessMessage, showWarningMessage } from '../utils/notifications/NotificationsHelper'; -import { makeExternalBuiltins as makeSourcerorExternalBuiltins } from '../utils/SourcerorHelper'; -import { showFullJSDisclaimer, showFullTSDisclaimer } from '../utils/WarningDialogHelper'; -import { notifyProgramEvaluated } from '../workspace/WorkspaceActions'; +} from 'src/commons/utils/JsSlangHelper'; +import { + showSuccessMessage, + showWarningMessage +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { makeExternalBuiltins as makeSourcerorExternalBuiltins } from 'src/commons/utils/SourcerorHelper'; +import { showFullJSDisclaimer, showFullTSDisclaimer } from 'src/commons/utils/WarningDialogHelper'; +import { notifyProgramEvaluated } from 'src/commons/workspace/WorkspaceActions'; import { ADD_HTML_CONSOLE_ERROR, BEGIN_CLEAR_CONTEXT, @@ -89,7 +95,15 @@ import { TOGGLE_FOLDER_MODE, UPDATE_EDITOR_VALUE, WorkspaceLocation -} from '../workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceTypes'; +import { EventType } from 'src/features/achievement/AchievementTypes'; +import DataVisualizer from 'src/features/dataVisualizer/dataVisualizer'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { DeviceSession } from 'src/features/remoteExecution/RemoteExecutionTypes'; +import { notifyStoriesEvaluated } from 'src/features/stories/StoriesActions'; +import { EVAL_STORY } from 'src/features/stories/StoriesTypes'; +import { WORKSPACE_BASE_PATHS } from 'src/pages/fileSystem/createInBrowserFileSystem'; + import { safeTakeEvery as takeEvery, safeTakeLeading as takeLeading } from './SafeEffects'; export default function* WorkspaceSaga(): SagaIterator { diff --git a/src/commons/sideBar/SideBar.tsx b/src/commons/sideBar/SideBar.tsx index e18d5083da..6a67766af9 100644 --- a/src/commons/sideBar/SideBar.tsx +++ b/src/commons/sideBar/SideBar.tsx @@ -1,8 +1,7 @@ import { Card, Icon, IconName } from '@blueprintjs/core'; import classNames from 'classnames'; import React from 'react'; - -import { SideContentType } from '../sideContent/SideContentTypes'; +import { SideContentType } from 'src/commons/sideContent/SideContentTypes'; /** * @property label The displayed name of the tab. diff --git a/src/commons/sideContent/GenericSideContent.tsx b/src/commons/sideContent/GenericSideContent.tsx index bdde9425d7..2f60f7f53f 100644 --- a/src/commons/sideContent/GenericSideContent.tsx +++ b/src/commons/sideContent/GenericSideContent.tsx @@ -1,9 +1,9 @@ import { TabId } from '@blueprintjs/core'; import React from 'react'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { DebuggerContext, WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { OverallState } from '../application/ApplicationTypes'; -import { useTypedSelector } from '../utils/Hooks'; -import { DebuggerContext, WorkspaceLocation } from '../workspace/WorkspaceTypes'; import { getDynamicTabs } from './SideContentHelper'; import { SideContentTab, SideContentType } from './SideContentTypes'; diff --git a/src/commons/sideContent/SideContent.tsx b/src/commons/sideContent/SideContent.tsx index 67099b3c5b..3552ed077f 100644 --- a/src/commons/sideContent/SideContent.tsx +++ b/src/commons/sideContent/SideContent.tsx @@ -1,10 +1,10 @@ import { Card, Icon, Tab, TabProps, Tabs } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; +import { propsAreEqual } from 'src/commons/utils/MemoizeHelper'; +import { assertType } from 'src/commons/utils/TypeHelper'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { propsAreEqual } from '../utils/MemoizeHelper'; -import { assertType } from '../utils/TypeHelper'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import GenericSideContent, { generateIconId, GenericSideContentProps } from './GenericSideContent'; import { SideContentTab, SideContentType } from './SideContentTypes'; diff --git a/src/commons/sideContent/SideContentAutograder.tsx b/src/commons/sideContent/SideContentAutograder.tsx index 5b11670d46..48d53cef16 100644 --- a/src/commons/sideContent/SideContentAutograder.tsx +++ b/src/commons/sideContent/SideContentAutograder.tsx @@ -2,10 +2,10 @@ import { Button, Collapse, Icon, PopoverPosition } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; +import { AutogradingResult, Testcase } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { AutogradingResult, Testcase } from '../assessment/AssessmentTypes'; -import ControlButton from '../ControlButton'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; import SideContentResultCard from './SideContentResultCard'; import SideContentTestcaseCard from './SideContentTestcaseCard'; diff --git a/src/commons/sideContent/SideContentContestLeaderboard.tsx b/src/commons/sideContent/SideContentContestLeaderboard.tsx index 85bc9d7311..a277551ca1 100644 --- a/src/commons/sideContent/SideContentContestLeaderboard.tsx +++ b/src/commons/sideContent/SideContentContestLeaderboard.tsx @@ -2,8 +2,8 @@ import { Button, Collapse, Icon } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React, { useMemo, useState } from 'react'; +import { ContestEntry } from 'src/commons/assessment/AssessmentTypes'; -import { ContestEntry } from '../assessment/AssessmentTypes'; import SideContentLeaderboardCard from './SideContentLeaderboardCard'; export type SideContentContestLeaderboardProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/SideContentContestVoting.tsx b/src/commons/sideContent/SideContentContestVoting.tsx index 55d16ca48e..46b3a01a3d 100644 --- a/src/commons/sideContent/SideContentContestVoting.tsx +++ b/src/commons/sideContent/SideContentContestVoting.tsx @@ -3,8 +3,7 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import classNames from 'classnames'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; - -import { ContestEntry } from '../assessment/AssessmentTypes'; +import { ContestEntry } from 'src/commons/assessment/AssessmentTypes'; export type SideContentContestVotingProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/SideContentContestVotingContainer.tsx b/src/commons/sideContent/SideContentContestVotingContainer.tsx index 90712f83e7..ca6b5ac38e 100644 --- a/src/commons/sideContent/SideContentContestVotingContainer.tsx +++ b/src/commons/sideContent/SideContentContestVotingContainer.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; +import { ContestEntry } from 'src/commons/assessment/AssessmentTypes'; import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; -import { ContestEntry } from '../assessment/AssessmentTypes'; import SideContentContestVoting from './SideContentContestVoting'; export type SideContentContestVotingContainerProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/SideContentDataVisualizer.tsx b/src/commons/sideContent/SideContentDataVisualizer.tsx index a91554f92a..c4c1605fce 100644 --- a/src/commons/sideContent/SideContentDataVisualizer.tsx +++ b/src/commons/sideContent/SideContentDataVisualizer.tsx @@ -3,10 +3,9 @@ import { IconNames } from '@blueprintjs/icons'; import classNames from 'classnames'; import * as React from 'react'; import { configure, GlobalHotKeys } from 'react-hotkeys'; - -import DataVisualizer from '../../features/dataVisualizer/dataVisualizer'; -import { Step } from '../../features/dataVisualizer/dataVisualizerTypes'; -import { Links } from '../utils/Constants'; +import { Links } from 'src/commons/utils/Constants'; +import DataVisualizer from 'src/features/dataVisualizer/dataVisualizer'; +import { Step } from 'src/features/dataVisualizer/dataVisualizerTypes'; type State = { steps: Step[]; diff --git a/src/commons/sideContent/SideContentEnvVisualizer.tsx b/src/commons/sideContent/SideContentEnvVisualizer.tsx index b8873da2f2..67538d873a 100644 --- a/src/commons/sideContent/SideContentEnvVisualizer.tsx +++ b/src/commons/sideContent/SideContentEnvVisualizer.tsx @@ -14,16 +14,18 @@ import * as React from 'react'; import { HotKeys } from 'react-hotkeys'; import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { HighlightedLines } from 'src/commons/editor/EditorTypes'; +import Constants, { Links } from 'src/commons/utils/Constants'; +import { + setEditorHighlightedLinesAgenda, + updateEnvSteps +} from 'src/commons/workspace/WorkspaceActions'; +import { evalEditor } from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; -import { OverallState } from '../application/ApplicationTypes'; -import { HighlightedLines } from '../editor/EditorTypes'; -import Constants, { Links } from '../utils/Constants'; -import { setEditorHighlightedLinesAgenda, updateEnvSteps } from '../workspace/WorkspaceActions'; -import { evalEditor } from '../workspace/WorkspaceActions'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; - type State = { visualization: React.ReactNode; value: number; diff --git a/src/commons/sideContent/SideContentHelper.ts b/src/commons/sideContent/SideContentHelper.ts index 2b4358f4de..0633ab7048 100644 --- a/src/commons/sideContent/SideContentHelper.ts +++ b/src/commons/sideContent/SideContentHelper.ts @@ -7,8 +7,8 @@ import React from 'react'; import JSXRuntime from 'react/jsx-runtime'; import * as ace from 'react-ace'; import ReactDOM from 'react-dom'; +import type { DebuggerContext } from 'src/commons/workspace/WorkspaceTypes'; -import type { DebuggerContext } from '../workspace/WorkspaceTypes'; import { ModuleSideContent, SideContentTab, SideContentType } from './SideContentTypes'; // const currentlyActiveTabsLabel: Map = new Map< diff --git a/src/commons/sideContent/SideContentLeaderboardCard.tsx b/src/commons/sideContent/SideContentLeaderboardCard.tsx index 23548dbbe0..00db9d5adb 100644 --- a/src/commons/sideContent/SideContentLeaderboardCard.tsx +++ b/src/commons/sideContent/SideContentLeaderboardCard.tsx @@ -1,8 +1,7 @@ import { Card, Classes, Elevation, Pre } from '@blueprintjs/core'; import classNames from 'classnames'; import React from 'react'; - -import { ContestEntry } from '../assessment/AssessmentTypes'; +import { ContestEntry } from 'src/commons/assessment/AssessmentTypes'; type SideContentLeaderboardCardProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/SideContentResultCard.tsx b/src/commons/sideContent/SideContentResultCard.tsx index 3502538b29..3da2a83502 100644 --- a/src/commons/sideContent/SideContentResultCard.tsx +++ b/src/commons/sideContent/SideContentResultCard.tsx @@ -1,8 +1,7 @@ import { Card, Elevation, Pre } from '@blueprintjs/core'; import classNames from 'classnames'; import * as React from 'react'; - -import { AutogradingError, AutogradingResult } from '../assessment/AssessmentTypes'; +import { AutogradingError, AutogradingResult } from 'src/commons/assessment/AssessmentTypes'; type SideContentResultCardProps = StateProps; diff --git a/src/commons/sideContent/SideContentTestcaseCard.tsx b/src/commons/sideContent/SideContentTestcaseCard.tsx index 2a35ffb0fa..41276d0430 100644 --- a/src/commons/sideContent/SideContentTestcaseCard.tsx +++ b/src/commons/sideContent/SideContentTestcaseCard.tsx @@ -3,9 +3,8 @@ import classNames from 'classnames'; import { parseError } from 'js-slang'; import { stringify } from 'js-slang/dist/utils/stringify'; import * as React from 'react'; - -import { Testcase, TestcaseTypes } from '../assessment/AssessmentTypes'; -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; +import { Testcase, TestcaseTypes } from 'src/commons/assessment/AssessmentTypes'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; type SideContentTestcaseCardProps = DispatchProps & StateProps & OwnProps; diff --git a/src/commons/sideContent/SideContentTypes.ts b/src/commons/sideContent/SideContentTypes.ts index c962f3cb98..11e6bc7e21 100644 --- a/src/commons/sideContent/SideContentTypes.ts +++ b/src/commons/sideContent/SideContentTypes.ts @@ -1,6 +1,5 @@ import { IconName } from '@blueprintjs/core'; - -import { DebuggerContext } from '../workspace/WorkspaceTypes'; +import { DebuggerContext } from 'src/commons/workspace/WorkspaceTypes'; export const NOTIFY_PROGRAM_EVALUATED = 'NOTIFY_PROGRAM_EVALUATED'; diff --git a/src/commons/sideContent/githubAssessments/SideContentEditableTestcaseCard.tsx b/src/commons/sideContent/githubAssessments/SideContentEditableTestcaseCard.tsx index 4ffb93d57d..96feeb3a35 100644 --- a/src/commons/sideContent/githubAssessments/SideContentEditableTestcaseCard.tsx +++ b/src/commons/sideContent/githubAssessments/SideContentEditableTestcaseCard.tsx @@ -4,8 +4,7 @@ import classNames from 'classnames'; import { parseError } from 'js-slang'; import { stringify } from 'js-slang/dist/utils/stringify'; import * as React from 'react'; - -import { Testcase, TestcaseTypes } from '../../assessment/AssessmentTypes'; +import { Testcase, TestcaseTypes } from 'src/commons/assessment/AssessmentTypes'; type SideContentEditableTestcaseCardProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/githubAssessments/SideContentMarkdownEditor.tsx b/src/commons/sideContent/githubAssessments/SideContentMarkdownEditor.tsx index d4b6be3625..b2138a3678 100644 --- a/src/commons/sideContent/githubAssessments/SideContentMarkdownEditor.tsx +++ b/src/commons/sideContent/githubAssessments/SideContentMarkdownEditor.tsx @@ -1,7 +1,6 @@ import { TextArea } from '@blueprintjs/core'; import React, { useEffect } from 'react'; - -import Markdown from '../../Markdown'; +import Markdown from 'src/commons/Markdown'; export type SideContentMarkdownEditorProps = { allowEdits: boolean; diff --git a/src/commons/sideContent/githubAssessments/SideContentMissionEditor.tsx b/src/commons/sideContent/githubAssessments/SideContentMissionEditor.tsx index 2705e57179..c4b9a41292 100644 --- a/src/commons/sideContent/githubAssessments/SideContentMissionEditor.tsx +++ b/src/commons/sideContent/githubAssessments/SideContentMissionEditor.tsx @@ -1,11 +1,10 @@ import { Label } from '@blueprintjs/core'; import { Chapter } from 'js-slang/dist/types'; import React from 'react'; - -import { SALanguage } from '../../application/ApplicationTypes'; -import { ControlBarChapterSelect } from '../../controlBar/ControlBarChapterSelect'; -import { MissionMetadata } from '../../githubAssessments/GitHubMissionTypes'; -import Constants from '../../utils/Constants'; +import { SALanguage } from 'src/commons/application/ApplicationTypes'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { MissionMetadata } from 'src/commons/githubAssessments/GitHubMissionTypes'; +import Constants from 'src/commons/utils/Constants'; export type SideContentMissionEditorProps = { isFolderModeEnabled: boolean; diff --git a/src/commons/sideContent/githubAssessments/SideContentTestcaseEditor.tsx b/src/commons/sideContent/githubAssessments/SideContentTestcaseEditor.tsx index 34d3f93c28..9992f9c412 100644 --- a/src/commons/sideContent/githubAssessments/SideContentTestcaseEditor.tsx +++ b/src/commons/sideContent/githubAssessments/SideContentTestcaseEditor.tsx @@ -3,11 +3,11 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; import AceEditor from 'react-ace'; +import { Testcase } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import SideContentTestcaseCard from 'src/commons/sideContent/SideContentTestcaseCard'; +import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; -import { Testcase } from '../../assessment/AssessmentTypes'; -import ControlButton from '../../ControlButton'; -import { showSimpleConfirmDialog } from '../../utils/DialogHelper'; -import SideContentTestcaseCard from '../SideContentTestcaseCard'; import SideContentEditableTestcaseCard from './SideContentEditableTestcaseCard'; export type SideContentTestcaseEditorProps = DispatchProps & StateProps; diff --git a/src/commons/sideContent/remoteExecution/SideContentRemoteExecution.tsx b/src/commons/sideContent/remoteExecution/SideContentRemoteExecution.tsx index 48ed1b929e..81e1e3c5a7 100644 --- a/src/commons/sideContent/remoteExecution/SideContentRemoteExecution.tsx +++ b/src/commons/sideContent/remoteExecution/SideContentRemoteExecution.tsx @@ -14,8 +14,11 @@ import { NavLink } from 'react-router-dom'; import BrickSvg from 'src/assets/BrickSvg'; import PortSvg from 'src/assets/PortSvg'; import { deleteDevice } from 'src/commons/sagas/RequestsSaga'; +import { actions } from 'src/commons/utils/ActionsHelper'; import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import PeripheralContainer from 'src/features/remoteExecution/PeripheralContainer'; import RemoteExecutionAddDeviceDialog from 'src/features/remoteExecution/RemoteExecutionDeviceDialog'; import { @@ -24,9 +27,6 @@ import { } from 'src/features/remoteExecution/RemoteExecutionEv3Types'; import { Device, DeviceSession } from 'src/features/remoteExecution/RemoteExecutionTypes'; -import { actions } from '../../utils/ActionsHelper'; -import { useTypedSelector } from '../../utils/Hooks'; -import { WorkspaceLocation } from '../../workspace/WorkspaceTypes'; import DeviceMenuItemButtons from './DeviceMenuItemButtons'; interface SideContentRemoteExecutionProps { diff --git a/src/commons/sourceRecorder/SourceRecorderControlBar.tsx b/src/commons/sourceRecorder/SourceRecorderControlBar.tsx index be584f9d97..bd2063ed75 100644 --- a/src/commons/sourceRecorder/SourceRecorderControlBar.tsx +++ b/src/commons/sourceRecorder/SourceRecorderControlBar.tsx @@ -2,17 +2,16 @@ import { ButtonGroup, Slider } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Chapter } from 'js-slang/dist/types'; import * as React from 'react'; - +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import ControlButton from 'src/commons/ControlButton'; +import { SideContentType } from 'src/commons/sideContent/SideContentTypes'; import { CodeDelta, Input, PlaybackData, PlaybackStatus, SourcecastData -} from '../../features/sourceRecorder/SourceRecorderTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import ControlButton from '../ControlButton'; -import { SideContentType } from '../sideContent/SideContentTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; export type SourceRecorderControlBarProps = DispatchProps & StateProps & OwnProps; diff --git a/src/commons/sourceRecorder/SourceRecorderDeleteCell.tsx b/src/commons/sourceRecorder/SourceRecorderDeleteCell.tsx index 6f582eb41e..a8dd5840e2 100644 --- a/src/commons/sourceRecorder/SourceRecorderDeleteCell.tsx +++ b/src/commons/sourceRecorder/SourceRecorderDeleteCell.tsx @@ -1,9 +1,8 @@ import { Classes, Dialog } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React, { useState } from 'react'; - -import { SourcecastData } from '../../features/sourceRecorder/SourceRecorderTypes'; -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; +import { SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; type SourceRecorderDeleteCellProps = DispatchProps & StateProps; diff --git a/src/commons/sourceRecorder/SourceRecorderEditor.tsx b/src/commons/sourceRecorder/SourceRecorderEditor.tsx index 9e707e1717..c3c1eb8c58 100644 --- a/src/commons/sourceRecorder/SourceRecorderEditor.tsx +++ b/src/commons/sourceRecorder/SourceRecorderEditor.tsx @@ -7,16 +7,15 @@ import { isEqual } from 'lodash'; import * as React from 'react'; import AceEditor, { IAceEditorProps } from 'react-ace'; import { HotKeys } from 'react-hotkeys'; - +import { EditorTabStateProps } from 'src/commons/editor/Editor'; +import { Position } from 'src/commons/editor/EditorTypes'; +import { EditorBinding } from 'src/commons/WorkspaceSettingsContext'; import { CodeDelta, Input, KeyboardCommand, SelectionRange -} from '../../features/sourceRecorder/SourceRecorderTypes'; -import { EditorTabStateProps } from '../editor/Editor'; -import { Position } from '../editor/EditorTypes'; -import { EditorBinding } from '../WorkspaceSettingsContext'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; /** * @property editorValue - The string content of the react-ace editor diff --git a/src/commons/sourceRecorder/SourceRecorderSelectCell.tsx b/src/commons/sourceRecorder/SourceRecorderSelectCell.tsx index 7ce1da2e4f..87bdd231e3 100644 --- a/src/commons/sourceRecorder/SourceRecorderSelectCell.tsx +++ b/src/commons/sourceRecorder/SourceRecorderSelectCell.tsx @@ -1,9 +1,8 @@ import { IconNames } from '@blueprintjs/icons'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; - -import { PlaybackData, SourcecastData } from '../../features/sourceRecorder/SourceRecorderTypes'; -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; +import { PlaybackData, SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; type SourceRecorderSelectCellProps = DispatchProps & StateProps; diff --git a/src/commons/sourceRecorder/SourceRecorderShareCell.tsx b/src/commons/sourceRecorder/SourceRecorderShareCell.tsx index 6c6afc9ce7..834706a487 100644 --- a/src/commons/sourceRecorder/SourceRecorderShareCell.tsx +++ b/src/commons/sourceRecorder/SourceRecorderShareCell.tsx @@ -2,9 +2,8 @@ import { IconNames } from '@blueprintjs/icons'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React, { useRef, useState } from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; - -import { SourcecastData } from '../../features/sourceRecorder/SourceRecorderTypes'; -import ControlButton from '../ControlButton'; +import ControlButton from 'src/commons/ControlButton'; +import { SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; type SourceRecorderShareCellProps = StateProps; diff --git a/src/commons/sourceRecorder/SourceRecorderTable.tsx b/src/commons/sourceRecorder/SourceRecorderTable.tsx index 16bba8ecd8..49a2916942 100644 --- a/src/commons/sourceRecorder/SourceRecorderTable.tsx +++ b/src/commons/sourceRecorder/SourceRecorderTable.tsx @@ -12,9 +12,9 @@ import { ColDef, GridApi, GridReadyEvent } from 'ag-grid-community'; import { AgGridReact } from 'ag-grid-react'; import { sortBy } from 'lodash'; import * as React from 'react'; +import { getStandardDate } from 'src/commons/utils/DateHelper'; +import { PlaybackData, SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; -import { PlaybackData, SourcecastData } from '../../features/sourceRecorder/SourceRecorderTypes'; -import { getStandardDate } from '../utils/DateHelper'; import SourcastDeleteCell from './SourceRecorderDeleteCell'; import SourceRecorderSelectCell from './SourceRecorderSelectCell'; import SourceRecorderShareCell from './SourceRecorderShareCell'; diff --git a/src/commons/utils/AceHelper.ts b/src/commons/utils/AceHelper.ts index a2554aa7a8..5599ec1762 100644 --- a/src/commons/utils/AceHelper.ts +++ b/src/commons/utils/AceHelper.ts @@ -1,8 +1,7 @@ import { HighlightRulesSelector, ModeSelector } from 'js-slang/dist/editors/ace/modes/source'; import { Chapter, Variant } from 'js-slang/dist/types'; - -import { HighlightRulesSelector_native } from '../../features/fullJS/fullJSHighlight'; -import { Documentation } from '../documentation/Documentation'; +import { Documentation } from 'src/commons/documentation/Documentation'; +import { HighlightRulesSelector_native } from 'src/features/fullJS/fullJSHighlight'; /** * This _modifies global state_ and defines a new Ace mode globally, if it does not already exist. * diff --git a/src/commons/utils/ActionsHelper.ts b/src/commons/utils/ActionsHelper.ts index be18e5e11a..04d0ce4419 100644 --- a/src/commons/utils/ActionsHelper.ts +++ b/src/commons/utils/ActionsHelper.ts @@ -1,24 +1,23 @@ +import * as CommonsActions from 'src/commons/application/actions/CommonsActions'; +import * as InterpreterActions from 'src/commons/application/actions/InterpreterActions'; +import * as SessionActions from 'src/commons/application/actions/SessionActions'; +import * as CollabEditingActions from 'src/commons/collabEditing/CollabEditingActions'; +import * as FileSystemActions from 'src/commons/fileSystem/FileSystemActions'; +import * as WorkspaceActions from 'src/commons/workspace/WorkspaceActions'; +import * as AcademyActions from 'src/features/academy/AcademyActions'; +import * as AchievementActions from 'src/features/achievement/AchievementActions'; +import * as DashboardActions from 'src/features/dashboard/DashboardActions'; +import * as GitHubActions from 'src/features/github/GitHubActions'; +import * as GroundControlActions from 'src/features/groundControl/GroundControlActions'; +import * as PersistenceActions from 'src/features/persistence/PersistenceActions'; +import * as PlaygroundActions from 'src/features/playground/PlaygroundActions'; +import * as RemoteExecutionActions from 'src/features/remoteExecution/RemoteExecutionActions'; +import * as SourcecastActions from 'src/features/sourceRecorder/sourcecast/SourcecastActions'; +import * as SourceRecorderActions from 'src/features/sourceRecorder/SourceRecorderActions'; +import * as SourcereelActions from 'src/features/sourceRecorder/sourcereel/SourcereelActions'; +import * as StoriesActions from 'src/features/stories/StoriesActions'; import { ActionType } from 'typesafe-actions'; -import * as CommonsActions from '../../commons/application/actions/CommonsActions'; -import * as InterpreterActions from '../../commons/application/actions/InterpreterActions'; -import * as SessionActions from '../../commons/application/actions/SessionActions'; -import * as CollabEditingActions from '../../commons/collabEditing/CollabEditingActions'; -import * as FileSystemActions from '../../commons/fileSystem/FileSystemActions'; -import * as WorkspaceActions from '../../commons/workspace/WorkspaceActions'; -import * as AcademyActions from '../../features/academy/AcademyActions'; -import * as AchievementActions from '../../features/achievement/AchievementActions'; -import * as DashboardActions from '../../features/dashboard/DashboardActions'; -import * as GitHubActions from '../../features/github/GitHubActions'; -import * as GroundControlActions from '../../features/groundControl/GroundControlActions'; -import * as PersistenceActions from '../../features/persistence/PersistenceActions'; -import * as PlaygroundActions from '../../features/playground/PlaygroundActions'; -import * as RemoteExecutionActions from '../../features/remoteExecution/RemoteExecutionActions'; -import * as SourcecastActions from '../../features/sourceRecorder/sourcecast/SourcecastActions'; -import * as SourceRecorderActions from '../../features/sourceRecorder/SourceRecorderActions'; -import * as SourcereelActions from '../../features/sourceRecorder/sourcereel/SourcereelActions'; -import * as StoriesActions from '../../features/stories/StoriesActions'; - export const actions = { ...AchievementActions, ...CommonsActions, diff --git a/src/commons/utils/CastBackend.ts b/src/commons/utils/CastBackend.ts index 49bf1fce94..e02232731a 100644 --- a/src/commons/utils/CastBackend.ts +++ b/src/commons/utils/CastBackend.ts @@ -1,5 +1,5 @@ -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { Library } from '../assessment/AssessmentTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { Library } from 'src/commons/assessment/AssessmentTypes'; /** * Casts a library returned by an API call to a diff --git a/src/commons/utils/DialogHelper.tsx b/src/commons/utils/DialogHelper.tsx index 85bdf4c366..5052366fbb 100644 --- a/src/commons/utils/DialogHelper.tsx +++ b/src/commons/utils/DialogHelper.tsx @@ -1,9 +1,9 @@ import { IconName, Intent } from '@blueprintjs/core'; import * as React from 'react'; import { createRoot } from 'react-dom/client'; +import { ConfirmDialog, ConfirmDialogProps } from 'src/commons/dialogs/ConfirmDialog'; +import { PromptDialog, PromptDialogProps } from 'src/commons/dialogs/PromptDialog'; -import { ConfirmDialog, ConfirmDialogProps } from '../dialogs/ConfirmDialog'; -import { PromptDialog, PromptDialogProps } from '../dialogs/PromptDialog'; import { PropsType } from './TypeHelper'; // The below is based off the Blueprint Toaster: diff --git a/src/commons/utils/DisplayBufferService.ts b/src/commons/utils/DisplayBufferService.ts index 79347a8df0..2fc42785e5 100644 --- a/src/commons/utils/DisplayBufferService.ts +++ b/src/commons/utils/DisplayBufferService.ts @@ -1,4 +1,5 @@ -import { WorkspaceLocation } from '../workspace/WorkspaceTypes'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; + import { consoleOverloads } from './ConsoleOverload'; class BufferService { diff --git a/src/commons/utils/Hooks.ts b/src/commons/utils/Hooks.ts index 0ff64eb32d..d1c3471272 100644 --- a/src/commons/utils/Hooks.ts +++ b/src/commons/utils/Hooks.ts @@ -1,8 +1,8 @@ import React, { RefObject } from 'react'; import { TypedUseSelectorHook, useSelector } from 'react-redux'; import { useMediaQuery } from 'react-responsive'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; -import { OverallState } from '../application/ApplicationTypes'; import Constants from './Constants'; import { readLocalStorage, setLocalStorage } from './LocalStorageHelper'; diff --git a/src/commons/utils/IntroductionHelper.ts b/src/commons/utils/IntroductionHelper.ts index c2bf5494cc..2c36c5ac73 100644 --- a/src/commons/utils/IntroductionHelper.ts +++ b/src/commons/utils/IntroductionHelper.ts @@ -1,6 +1,6 @@ import { Chapter, Variant } from 'js-slang/dist/types'; +import { SALanguage, styliseSublanguage } from 'src/commons/application/ApplicationTypes'; -import { SALanguage, styliseSublanguage } from '../application/ApplicationTypes'; import { Links } from './Constants'; const MAIN_INTRODUCTION = ` diff --git a/src/commons/utils/JsSlangHelper.ts b/src/commons/utils/JsSlangHelper.ts index c90c5d4fcd..c17ad0254c 100644 --- a/src/commons/utils/JsSlangHelper.ts +++ b/src/commons/utils/JsSlangHelper.ts @@ -3,10 +3,10 @@ import createSlangContext, { defineBuiltin, importBuiltins } from 'js-slang/dist import { Chapter, Context, CustomBuiltIns, Value, Variant } from 'js-slang/dist/types'; import { stringify } from 'js-slang/dist/utils/stringify'; import { difference, keys } from 'lodash'; +import DataVisualizer from 'src/features/dataVisualizer/dataVisualizer'; +import { Data } from 'src/features/dataVisualizer/dataVisualizerTypes'; import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; -import DataVisualizer from '../../features/dataVisualizer/dataVisualizer'; -import { Data } from '../../features/dataVisualizer/dataVisualizerTypes'; import DisplayBufferService from './DisplayBufferService'; /** diff --git a/src/commons/utils/ParamParseHelper.ts b/src/commons/utils/ParamParseHelper.ts index 71cad368c4..f1019f622d 100644 --- a/src/commons/utils/ParamParseHelper.ts +++ b/src/commons/utils/ParamParseHelper.ts @@ -1,4 +1,4 @@ -import { AssessmentType } from '../assessment/AssessmentTypes'; +import { AssessmentType } from 'src/commons/assessment/AssessmentTypes'; /** * Converts an AssessmentType into a string for use in URLs. diff --git a/src/commons/utils/RequestHelper.tsx b/src/commons/utils/RequestHelper.tsx index f40008a762..cdb5cb772f 100644 --- a/src/commons/utils/RequestHelper.tsx +++ b/src/commons/utils/RequestHelper.tsx @@ -1,10 +1,10 @@ import { Button } from '@blueprintjs/core'; import _ from 'lodash'; +import { Tokens } from 'src/commons/application/types/SessionTypes'; +import { postRefresh } from 'src/commons/sagas/RequestsSaga'; import { assessmentFullPathRegex } from 'src/features/academy/AcademyTypes'; import { store } from 'src/pages/createStore'; -import { Tokens } from '../application/types/SessionTypes'; -import { postRefresh } from '../sagas/RequestsSaga'; import { MockResponse } from './__tests__/RequestHelper'; import { actions } from './ActionsHelper'; import Constants from './Constants'; diff --git a/src/commons/utils/SourcerorHelper.ts b/src/commons/utils/SourcerorHelper.ts index dbbaa25ea1..43930eebc6 100644 --- a/src/commons/utils/SourcerorHelper.ts +++ b/src/commons/utils/SourcerorHelper.ts @@ -1,6 +1,5 @@ import { Context } from 'js-slang/dist/types'; - -import { handleConsoleLog } from '../application/actions/InterpreterActions'; +import { handleConsoleLog } from 'src/commons/application/actions/InterpreterActions'; export function makeExternalBuiltins(context: Context): any { return { diff --git a/src/commons/workspace/Workspace.tsx b/src/commons/workspace/Workspace.tsx index 6369ec349e..07390c67d5 100644 --- a/src/commons/workspace/Workspace.tsx +++ b/src/commons/workspace/Workspace.tsx @@ -2,15 +2,14 @@ import { FocusStyleManager } from '@blueprintjs/core'; import { Enable, NumberSize, Resizable, ResizableProps, ResizeCallback } from 're-resizable'; import { Direction } from 're-resizable/lib/resizer'; import * as React from 'react'; - -import ControlBar, { ControlBarProps } from '../controlBar/ControlBar'; -import EditorContainer, { EditorContainerProps } from '../editor/EditorContainer'; -import McqChooser, { McqChooserProps } from '../mcqChooser/McqChooser'; -import { Prompt } from '../ReactRouterPrompt'; -import Repl, { ReplProps } from '../repl/Repl'; -import SideBar, { SideBarTab } from '../sideBar/SideBar'; -import SideContent, { SideContentProps } from '../sideContent/SideContent'; -import { useDimensions } from '../utils/Hooks'; +import ControlBar, { ControlBarProps } from 'src/commons/controlBar/ControlBar'; +import EditorContainer, { EditorContainerProps } from 'src/commons/editor/EditorContainer'; +import McqChooser, { McqChooserProps } from 'src/commons/mcqChooser/McqChooser'; +import { Prompt } from 'src/commons/ReactRouterPrompt'; +import Repl, { ReplProps } from 'src/commons/repl/Repl'; +import SideBar, { SideBarTab } from 'src/commons/sideBar/SideBar'; +import SideContent, { SideContentProps } from 'src/commons/sideContent/SideContent'; +import { useDimensions } from 'src/commons/utils/Hooks'; export type WorkspaceProps = DispatchProps & StateProps; diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index 4455e8279b..60bd9dfee1 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -1,17 +1,17 @@ import { Context } from 'js-slang'; import { Chapter, Variant } from 'js-slang/dist/types'; -import { action } from 'typesafe-actions'; - -import { SET_IS_EDITOR_READONLY } from '../../features/sourceRecorder/sourcecast/SourcecastTypes'; -import { SALanguage } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; +import { SALanguage } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { UPDATE_EDITOR_HIGHLIGHTED_LINES, UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA -} from '../application/types/InterpreterTypes'; -import { Library } from '../assessment/AssessmentTypes'; -import { HighlightedLines, Position } from '../editor/EditorTypes'; -import { NOTIFY_PROGRAM_EVALUATED } from '../sideContent/SideContentTypes'; +} from 'src/commons/application/types/InterpreterTypes'; +import { Library } from 'src/commons/assessment/AssessmentTypes'; +import { HighlightedLines, Position } from 'src/commons/editor/EditorTypes'; +import { NOTIFY_PROGRAM_EVALUATED } from 'src/commons/sideContent/SideContentTypes'; +import { SET_IS_EDITOR_READONLY } from 'src/features/sourceRecorder/sourcecast/SourcecastTypes'; +import { action } from 'typesafe-actions'; + import { ADD_EDITOR_TAB, ADD_HTML_CONSOLE_ERROR, diff --git a/src/commons/workspace/WorkspaceReducer.ts b/src/commons/workspace/WorkspaceReducer.ts index db435d5889..d41eaf4a99 100644 --- a/src/commons/workspace/WorkspaceReducer.ts +++ b/src/commons/workspace/WorkspaceReducer.ts @@ -1,9 +1,5 @@ import { stringify } from 'js-slang/dist/utils/stringify'; import { Reducer } from 'redux'; - -import { SourcecastReducer } from '../../features/sourceRecorder/sourcecast/SourcecastReducer'; -import { SET_IS_EDITOR_READONLY } from '../../features/sourceRecorder/sourcecast/SourcecastTypes'; -import { SourcereelReducer } from '../../features/sourceRecorder/sourcereel/SourcereelReducer'; import { CodeOutput, createDefaultWorkspace, @@ -11,8 +7,8 @@ import { ErrorOutput, InterpreterOutput, ResultOutput -} from '../application/ApplicationTypes'; -import { LOG_OUT } from '../application/types/CommonsTypes'; +} from 'src/commons/application/ApplicationTypes'; +import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; import { DEBUG_RESET, DEBUG_RESUME, @@ -25,13 +21,20 @@ import { HANDLE_CONSOLE_LOG, UPDATE_EDITOR_HIGHLIGHTED_LINES, UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA -} from '../application/types/InterpreterTypes'; -import { Testcase } from '../assessment/AssessmentTypes'; -import { SET_EDITOR_SESSION_ID, SET_SHAREDB_CONNECTED } from '../collabEditing/CollabEditingTypes'; -import { NOTIFY_PROGRAM_EVALUATED } from '../sideContent/SideContentTypes'; -import { SourceActionType } from '../utils/ActionsHelper'; -import Constants from '../utils/Constants'; -import { createContext } from '../utils/JsSlangHelper'; +} from 'src/commons/application/types/InterpreterTypes'; +import { Testcase } from 'src/commons/assessment/AssessmentTypes'; +import { + SET_EDITOR_SESSION_ID, + SET_SHAREDB_CONNECTED +} from 'src/commons/collabEditing/CollabEditingTypes'; +import { NOTIFY_PROGRAM_EVALUATED } from 'src/commons/sideContent/SideContentTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; +import Constants from 'src/commons/utils/Constants'; +import { createContext } from 'src/commons/utils/JsSlangHelper'; +import { SourcecastReducer } from 'src/features/sourceRecorder/sourcecast/SourcecastReducer'; +import { SET_IS_EDITOR_READONLY } from 'src/features/sourceRecorder/sourcecast/SourcecastTypes'; +import { SourcereelReducer } from 'src/features/sourceRecorder/sourcereel/SourcereelReducer'; + import { ADD_EDITOR_TAB, BROWSE_REPL_HISTORY_DOWN, diff --git a/src/commons/workspace/WorkspaceTypes.ts b/src/commons/workspace/WorkspaceTypes.ts index 9bb553f361..51a500f3c4 100644 --- a/src/commons/workspace/WorkspaceTypes.ts +++ b/src/commons/workspace/WorkspaceTypes.ts @@ -1,12 +1,11 @@ import { Context } from 'js-slang'; - -import { GitHubAssessmentWorkspaceState } from '../../features/githubAssessment/GitHubAssessmentTypes'; -import { SourcecastWorkspaceState } from '../../features/sourceRecorder/sourcecast/SourcecastTypes'; -import { SourcereelWorkspaceState } from '../../features/sourceRecorder/sourcereel/SourcereelTypes'; -import { InterpreterOutput } from '../application/ApplicationTypes'; -import { ExternalLibraryName } from '../application/types/ExternalTypes'; -import { AutogradingResult, Testcase } from '../assessment/AssessmentTypes'; -import { HighlightedLines, Position } from '../editor/EditorTypes'; +import { InterpreterOutput } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { AutogradingResult, Testcase } from 'src/commons/assessment/AssessmentTypes'; +import { HighlightedLines, Position } from 'src/commons/editor/EditorTypes'; +import { GitHubAssessmentWorkspaceState } from 'src/features/githubAssessment/GitHubAssessmentTypes'; +import { SourcecastWorkspaceState } from 'src/features/sourceRecorder/sourcecast/SourcecastTypes'; +import { SourcereelWorkspaceState } from 'src/features/sourceRecorder/sourcereel/SourcereelTypes'; export const ADD_HTML_CONSOLE_ERROR = 'ADD_HTML_CONSOLE_ERROR'; export const BEGIN_CLEAR_CONTEXT = 'BEGIN_CLEAR_CONTEXT'; diff --git a/src/features/academy/AcademyReducer.ts b/src/features/academy/AcademyReducer.ts index 4daa1ceca7..ac21005c16 100644 --- a/src/features/academy/AcademyReducer.ts +++ b/src/features/academy/AcademyReducer.ts @@ -1,8 +1,8 @@ import { Reducer } from 'redux'; +import { defaultAcademy } from 'src/commons/application/ApplicationTypes'; +import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultAcademy } from '../../commons/application/ApplicationTypes'; -import { LOG_OUT } from '../../commons/application/types/CommonsTypes'; -import { SourceActionType } from '../../commons/utils/ActionsHelper'; import { AcademyState, SAVE_CANVAS } from './AcademyTypes'; export const AcademyReducer: Reducer = ( diff --git a/src/features/achievement/AchievementConstants.ts b/src/features/achievement/AchievementConstants.ts index 9acec4417f..4b62661482 100644 --- a/src/features/achievement/AchievementConstants.ts +++ b/src/features/achievement/AchievementConstants.ts @@ -1,7 +1,7 @@ import React from 'react'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import { Links } from 'src/commons/utils/Constants'; -import AchievementInferencer from '../../commons/achievement/utils/AchievementInferencer'; -import { Links } from '../../commons/utils/Constants'; import { FilterStatus } from './AchievementTypes'; export const AchievementContext = React.createContext(new AchievementInferencer([], [])); diff --git a/src/features/achievement/AchievementReducer.ts b/src/features/achievement/AchievementReducer.ts index dce3b94195..11049d788a 100644 --- a/src/features/achievement/AchievementReducer.ts +++ b/src/features/achievement/AchievementReducer.ts @@ -1,7 +1,7 @@ import { Reducer } from 'redux'; +import { defaultAchievement } from 'src/commons/application/ApplicationTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultAchievement } from '../../commons/application/ApplicationTypes'; -import { SourceActionType } from '../../commons/utils/ActionsHelper'; import { AchievementState, SAVE_ACHIEVEMENTS, diff --git a/src/features/assessments/AssessmentUtils.ts b/src/features/assessments/AssessmentUtils.ts index 029d2d80d0..77cde1785b 100644 --- a/src/features/assessments/AssessmentUtils.ts +++ b/src/features/assessments/AssessmentUtils.ts @@ -1,12 +1,11 @@ import { stringify } from 'js-slang/dist/utils/stringify'; - import { IMCQQuestion, Question, QuestionTypes, Testcase -} from '../../commons/assessment/AssessmentTypes'; -import { showWarningMessage } from '../../commons/utils/notifications/NotificationsHelper'; +} from 'src/commons/assessment/AssessmentTypes'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; /** * Returns a nullary function that defers the navigation of the browser window, until the diff --git a/src/features/dashboard/DashboardReducer.ts b/src/features/dashboard/DashboardReducer.ts index 43ced5ec2e..cfb51df5b7 100644 --- a/src/features/dashboard/DashboardReducer.ts +++ b/src/features/dashboard/DashboardReducer.ts @@ -1,7 +1,7 @@ import { Reducer } from 'redux'; +import { defaultDashboard } from 'src/commons/application/ApplicationTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultDashboard } from '../../commons/application/ApplicationTypes'; -import { SourceActionType } from '../../commons/utils/ActionsHelper'; import { DashboardState, UPDATE_GROUP_GRADING_SUMMARY } from './DashboardTypes'; export const DashboardReducer: Reducer = ( diff --git a/src/features/dataVisualizer/drawable/ArrayDrawable.tsx b/src/features/dataVisualizer/drawable/ArrayDrawable.tsx index 494004da84..4c628d5677 100644 --- a/src/features/dataVisualizer/drawable/ArrayDrawable.tsx +++ b/src/features/dataVisualizer/drawable/ArrayDrawable.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { Group, Line, Rect, Text } from 'react-konva'; +import { Config } from 'src/features/dataVisualizer/Config'; +import DataVisualizer from 'src/features/dataVisualizer/dataVisualizer'; +import { isEmptyList, isList, toText } from 'src/features/dataVisualizer/dataVisualizerUtils'; +import { DataTreeNode, TreeNode } from 'src/features/dataVisualizer/tree/TreeNode'; -import { Config } from '../Config'; -import DataVisualizer from '../dataVisualizer'; -import { isEmptyList, isList, toText } from '../dataVisualizerUtils'; -import { DataTreeNode, TreeNode } from '../tree/TreeNode'; import { NullDrawable } from './Drawable'; type ArrayProps = { diff --git a/src/features/dataVisualizer/drawable/ArrowDrawable.tsx b/src/features/dataVisualizer/drawable/ArrowDrawable.tsx index ee62c70699..a03d8278f9 100644 --- a/src/features/dataVisualizer/drawable/ArrowDrawable.tsx +++ b/src/features/dataVisualizer/drawable/ArrowDrawable.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Arrow } from 'react-konva'; - -import { Config } from '../Config'; +import { Config } from 'src/features/dataVisualizer/Config'; type ArrowConfig = { from: { x: number; y: number }; to: { x: number; y: number } }; diff --git a/src/features/dataVisualizer/drawable/BackwardArrowDrawable.tsx b/src/features/dataVisualizer/drawable/BackwardArrowDrawable.tsx index 66f88a68fb..41ea0b55e0 100644 --- a/src/features/dataVisualizer/drawable/BackwardArrowDrawable.tsx +++ b/src/features/dataVisualizer/drawable/BackwardArrowDrawable.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Arrow } from 'react-konva'; - -import { Config } from '../Config'; +import { Config } from 'src/features/dataVisualizer/Config'; type ArrowConfig = { from: { x: number; y: number }; to: { x: number; y: number } }; diff --git a/src/features/dataVisualizer/drawable/FunctionDrawable.tsx b/src/features/dataVisualizer/drawable/FunctionDrawable.tsx index 50bff25a68..a25b9e7a3b 100644 --- a/src/features/dataVisualizer/drawable/FunctionDrawable.tsx +++ b/src/features/dataVisualizer/drawable/FunctionDrawable.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Circle, Group } from 'react-konva'; - -import { Config } from '../Config'; +import { Config } from 'src/features/dataVisualizer/Config'; type FunctionProps = { x: number; diff --git a/src/features/dataVisualizer/drawable/NullDrawable.tsx b/src/features/dataVisualizer/drawable/NullDrawable.tsx index e588803caa..489e55dd65 100644 --- a/src/features/dataVisualizer/drawable/NullDrawable.tsx +++ b/src/features/dataVisualizer/drawable/NullDrawable.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Line } from 'react-konva'; - -import { Config } from '../Config'; +import { Config } from 'src/features/dataVisualizer/Config'; type NullProps = { x: number; diff --git a/src/features/dataVisualizer/tree/ArrayTreeNode.tsx b/src/features/dataVisualizer/tree/ArrayTreeNode.tsx index f33ed98601..25a842e679 100644 --- a/src/features/dataVisualizer/tree/ArrayTreeNode.tsx +++ b/src/features/dataVisualizer/tree/ArrayTreeNode.tsx @@ -1,7 +1,7 @@ import { Group } from 'react-konva'; +import { Config } from 'src/features/dataVisualizer/Config'; +import { ArrayDrawable, ArrowDrawable } from 'src/features/dataVisualizer/drawable/Drawable'; -import { Config } from '../Config'; -import { ArrayDrawable, ArrowDrawable } from '../drawable/Drawable'; import { DrawableTreeNode } from './DrawableTreeNode'; /** diff --git a/src/features/dataVisualizer/tree/DataTreeNode.tsx b/src/features/dataVisualizer/tree/DataTreeNode.tsx index 01ac176b41..8fc0ca8400 100644 --- a/src/features/dataVisualizer/tree/DataTreeNode.tsx +++ b/src/features/dataVisualizer/tree/DataTreeNode.tsx @@ -1,4 +1,5 @@ -import { Data } from '../dataVisualizerTypes'; +import { Data } from 'src/features/dataVisualizer/dataVisualizerTypes'; + import { TreeNode } from './BaseTreeNode'; /** diff --git a/src/features/dataVisualizer/tree/FunctionTreeNode.tsx b/src/features/dataVisualizer/tree/FunctionTreeNode.tsx index 95407b8907..c5f9827971 100644 --- a/src/features/dataVisualizer/tree/FunctionTreeNode.tsx +++ b/src/features/dataVisualizer/tree/FunctionTreeNode.tsx @@ -1,7 +1,7 @@ import { Group } from 'react-konva'; +import { Config } from 'src/features/dataVisualizer/Config'; +import { ArrowDrawable, FunctionDrawable } from 'src/features/dataVisualizer/drawable/Drawable'; -import { Config } from '../Config'; -import { ArrowDrawable, FunctionDrawable } from '../drawable/Drawable'; import { DrawableTreeNode } from './DrawableTreeNode'; /** diff --git a/src/features/dataVisualizer/tree/Tree.tsx b/src/features/dataVisualizer/tree/Tree.tsx index 8e02a04494..ac88d0082b 100644 --- a/src/features/dataVisualizer/tree/Tree.tsx +++ b/src/features/dataVisualizer/tree/Tree.tsx @@ -1,10 +1,13 @@ import Konva from 'konva'; import { Layer, Text } from 'react-konva'; +import { Config } from 'src/features/dataVisualizer/Config'; +import { Data, Pair } from 'src/features/dataVisualizer/dataVisualizerTypes'; +import { isArray, isFunction, toText } from 'src/features/dataVisualizer/dataVisualizerUtils'; +import { + ArrowDrawable, + BackwardArrowDrawable +} from 'src/features/dataVisualizer/drawable/Drawable'; -import { Config } from '../Config'; -import { Data, Pair } from '../dataVisualizerTypes'; -import { isArray, isFunction, toText } from '../dataVisualizerUtils'; -import { ArrowDrawable, BackwardArrowDrawable } from '../drawable/Drawable'; import { AlreadyParsedTreeNode } from './AlreadyParsedTreeNode'; import { ArrayTreeNode, diff --git a/src/features/envVisualizer/compactComponents/AgendaItemComponent.tsx b/src/features/envVisualizer/compactComponents/AgendaItemComponent.tsx index f877360c17..6ae74e4c97 100644 --- a/src/features/envVisualizer/compactComponents/AgendaItemComponent.tsx +++ b/src/features/envVisualizer/compactComponents/AgendaItemComponent.tsx @@ -1,11 +1,13 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React, { RefObject } from 'react'; import { Label, Tag, Text } from 'react-konva'; - -import { Visible } from '../components/Visible'; -import { AgendaStashConfig, ShapeDefaultProps } from '../EnvVisualizerAgendaStash'; -import { Layout } from '../EnvVisualizerLayout'; -import { IHoverable } from '../EnvVisualizerTypes'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { + AgendaStashConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerAgendaStash'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; import { currentItemSAColor, getTextHeight, @@ -14,7 +16,8 @@ import { setUnhoveredCursor, setUnhoveredStyle, truncateText -} from '../EnvVisualizerUtils'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { ArrowFromAgendaItemComponent } from './arrows/ArrowFromAgendaItemComponent'; import { Frame } from './Frame'; diff --git a/src/features/envVisualizer/compactComponents/AgendaStack.tsx b/src/features/envVisualizer/compactComponents/AgendaStack.tsx index 6f18087643..3ae4aae752 100644 --- a/src/features/envVisualizer/compactComponents/AgendaStack.tsx +++ b/src/features/envVisualizer/compactComponents/AgendaStack.tsx @@ -4,13 +4,12 @@ import { AgendaItem, Instr } from 'js-slang/dist/ec-evaluator/types'; import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; import { Group, Label, Tag, Text } from 'react-konva'; - -import { Visible } from '../components/Visible'; -import EnvVisualizer from '../EnvVisualizer'; -import { AgendaStashConfig } from '../EnvVisualizerAgendaStash'; -import { CompactConfig } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { IHoverable } from '../EnvVisualizerTypes'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { AgendaStashConfig } from 'src/features/envVisualizer/EnvVisualizerAgendaStash'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; import { defaultSAColor, getAgendaItemComponent, @@ -18,7 +17,8 @@ import { setHoveredStyle, setUnhoveredCursor, setUnhoveredStyle -} from '../EnvVisualizerUtils'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { AgendaItemComponent } from './AgendaItemComponent'; export class AgendaStack extends Visible implements IHoverable { diff --git a/src/features/envVisualizer/compactComponents/ArrayEmptyUnit.tsx b/src/features/envVisualizer/compactComponents/ArrayEmptyUnit.tsx index d8bc4e2be4..0393dcf881 100644 --- a/src/features/envVisualizer/compactComponents/ArrayEmptyUnit.tsx +++ b/src/features/envVisualizer/compactComponents/ArrayEmptyUnit.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { Rect } from 'react-konva'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { defaultSAColor } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Visible } from '../components/Visible'; -import { ShapeDefaultProps } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; -import { defaultSAColor } from '../EnvVisualizerUtils'; import { ArrayValue } from './values/ArrayValue'; /** this classes encapsulates an empty array */ diff --git a/src/features/envVisualizer/compactComponents/ArrayNullUnit.tsx b/src/features/envVisualizer/compactComponents/ArrayNullUnit.tsx index 3812794f2c..7f6771fbc6 100644 --- a/src/features/envVisualizer/compactComponents/ArrayNullUnit.tsx +++ b/src/features/envVisualizer/compactComponents/ArrayNullUnit.tsx @@ -1,11 +1,13 @@ import React from 'react'; import { Line as KonvaLine } from 'react-konva'; - -import { Visible } from '../components/Visible'; -import { CompactConfig, ShapeDefaultProps } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { CompactReferenceType, ReferenceType } from '../EnvVisualizerTypes'; -import { defaultSAColor } from '../EnvVisualizerUtils'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { CompactReferenceType, ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { defaultSAColor } from 'src/features/envVisualizer/EnvVisualizerUtils'; /** this classes encapsulates a null value in Source pairs or arrays */ export class ArrayNullUnit extends Visible { diff --git a/src/features/envVisualizer/compactComponents/ArrayUnit.tsx b/src/features/envVisualizer/compactComponents/ArrayUnit.tsx index 653dcbdf88..71d7aeb37c 100644 --- a/src/features/envVisualizer/compactComponents/ArrayUnit.tsx +++ b/src/features/envVisualizer/compactComponents/ArrayUnit.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import { RoundedRect } from 'src/features/envVisualizer/components/shapes/RoundedRect'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { defaultSAColor } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { RoundedRect } from '../components/shapes/RoundedRect'; -import { Visible } from '../components/Visible'; -import { CompactConfig } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; -import { defaultSAColor } from '../EnvVisualizerUtils'; import { Arrow } from './arrows/Arrow'; import { ArrowFromArrayUnit } from './arrows/ArrowFromArrayUnit'; import { ArrayValue } from './values/ArrayValue'; diff --git a/src/features/envVisualizer/compactComponents/Binding.tsx b/src/features/envVisualizer/compactComponents/Binding.tsx index 4295a5ee7a..217c32d156 100644 --- a/src/features/envVisualizer/compactComponents/Binding.tsx +++ b/src/features/envVisualizer/compactComponents/Binding.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { isCompactMainReference, isDummyKey } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Visible } from '../components/Visible'; -import { CompactConfig } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; -import { isCompactMainReference, isDummyKey } from '../EnvVisualizerUtils'; import { ArrowFromText } from './arrows/ArrowFromText'; import { GenericArrow } from './arrows/GenericArrow'; import { Frame } from './Frame'; diff --git a/src/features/envVisualizer/compactComponents/Frame.tsx b/src/features/envVisualizer/compactComponents/Frame.tsx index 773436eb90..9267bbcf80 100644 --- a/src/features/envVisualizer/compactComponents/Frame.tsx +++ b/src/features/envVisualizer/compactComponents/Frame.tsx @@ -1,11 +1,13 @@ import React from 'react'; import { Group, Rect } from 'react-konva'; - -import { Visible } from '../components/Visible'; -import EnvVisualizer from '../EnvVisualizer'; -import { CompactConfig, ShapeDefaultProps } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Env, EnvTreeNode, IHoverable } from '../EnvVisualizerTypes'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Env, EnvTreeNode, IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; import { currentItemSAColor, getNonEmptyEnv, @@ -13,7 +15,8 @@ import { isDummyKey, isPrimitiveData, isUnassigned -} from '../EnvVisualizerUtils'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { ArrowFromFrame } from './arrows/ArrowFromFrame'; import { Binding } from './Binding'; import { Level } from './Level'; diff --git a/src/features/envVisualizer/compactComponents/Level.tsx b/src/features/envVisualizer/compactComponents/Level.tsx index 0562da1274..e7e37a279a 100644 --- a/src/features/envVisualizer/compactComponents/Level.tsx +++ b/src/features/envVisualizer/compactComponents/Level.tsx @@ -1,12 +1,15 @@ import React from 'react'; import { Group, Rect } from 'react-konva'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { AgendaStashConfig } from 'src/features/envVisualizer/EnvVisualizerAgendaStash'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { EnvTreeNode } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import { Visible } from '../components/Visible'; -import EnvVisualizer from '../EnvVisualizer'; -import { AgendaStashConfig } from '../EnvVisualizerAgendaStash'; -import { CompactConfig, ShapeDefaultProps } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { EnvTreeNode } from '../EnvVisualizerTypes'; import { Frame } from './Frame'; /** this class encapsulates a level of frames to be drawn with the same y values */ diff --git a/src/features/envVisualizer/compactComponents/StashItemComponent.tsx b/src/features/envVisualizer/compactComponents/StashItemComponent.tsx index 83af080bb2..c29d5ddaf8 100644 --- a/src/features/envVisualizer/compactComponents/StashItemComponent.tsx +++ b/src/features/envVisualizer/compactComponents/StashItemComponent.tsx @@ -1,13 +1,15 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React, { RefObject } from 'react'; import { Label, Tag, Text } from 'react-konva'; - -import { FnValue } from '../components/values/FnValue'; -import { GlobalFnValue } from '../components/values/GlobalFnValue'; -import { Visible } from '../components/Visible'; -import { AgendaStashConfig, ShapeDefaultProps } from '../EnvVisualizerAgendaStash'; -import { Layout } from '../EnvVisualizerLayout'; -import { IHoverable } from '../EnvVisualizerTypes'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { + AgendaStashConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerAgendaStash'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; import { getTextWidth, isArray, @@ -19,7 +21,8 @@ import { setUnhoveredStyle, stackItemSAColor, truncateText -} from '../EnvVisualizerUtils'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { ArrowFromStashItemComponent } from './arrows/ArrowFromStashItemComponent'; import { ArrayValue } from './values/ArrayValue'; diff --git a/src/features/envVisualizer/compactComponents/StashStack.tsx b/src/features/envVisualizer/compactComponents/StashStack.tsx index 34c6935c00..06297b8f57 100644 --- a/src/features/envVisualizer/compactComponents/StashStack.tsx +++ b/src/features/envVisualizer/compactComponents/StashStack.tsx @@ -3,13 +3,13 @@ import { Value } from 'js-slang/dist/types'; import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; import { Group } from 'react-konva'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { AgendaStashConfig } from 'src/features/envVisualizer/EnvVisualizerAgendaStash'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getStashItemComponent } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Visible } from '../components/Visible'; -import EnvVisualizer from '../EnvVisualizer'; -import { AgendaStashConfig } from '../EnvVisualizerAgendaStash'; -import { Layout } from '../EnvVisualizerLayout'; -import { IHoverable } from '../EnvVisualizerTypes'; -import { getStashItemComponent } from '../EnvVisualizerUtils'; import { StashItemComponent } from './StashItemComponent'; export class StashStack extends Visible implements IHoverable { diff --git a/src/features/envVisualizer/compactComponents/Text.tsx b/src/features/envVisualizer/compactComponents/Text.tsx index a4e0c84f0c..f52f2b2bf2 100644 --- a/src/features/envVisualizer/compactComponents/Text.tsx +++ b/src/features/envVisualizer/compactComponents/Text.tsx @@ -1,12 +1,18 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; import { Label as KonvaLabel, Tag as KonvaTag, Text as KonvaText } from 'react-konva'; - -import { Visible } from '../components/Visible'; -import { CompactConfig, ShapeDefaultProps } from '../EnvVisualizerCompactConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data, IHoverable } from '../EnvVisualizerTypes'; -import { getTextWidth, setHoveredCursor, setUnhoveredCursor } from '../EnvVisualizerUtils'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data, IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { + getTextWidth, + setHoveredCursor, + setUnhoveredCursor +} from 'src/features/envVisualizer/EnvVisualizerUtils'; export interface TextOptions { maxWidth: number; diff --git a/src/features/envVisualizer/compactComponents/arrows/Arrow.tsx b/src/features/envVisualizer/compactComponents/arrows/Arrow.tsx index d78236d329..ee1ad197a4 100644 --- a/src/features/envVisualizer/compactComponents/arrows/Arrow.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/Arrow.tsx @@ -1,14 +1,14 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React, { RefObject } from 'react'; +import { AgendaItemComponent } from 'src/features/envVisualizer/compactComponents/AgendaItemComponent'; +import { ArrayUnit } from 'src/features/envVisualizer/compactComponents/ArrayUnit'; +import { Frame } from 'src/features/envVisualizer/compactComponents/Frame'; +import { StashItemComponent } from 'src/features/envVisualizer/compactComponents/StashItemComponent'; +import { Text } from 'src/features/envVisualizer/compactComponents/Text'; +import { FnValue } from 'src/features/envVisualizer/compactComponents/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/compactComponents/values/GlobalFnValue'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; -import { Visible } from '../../components/Visible'; -import { AgendaItemComponent } from '../AgendaItemComponent'; -import { ArrayUnit } from '../ArrayUnit'; -import { Frame } from '../Frame'; -import { StashItemComponent } from '../StashItemComponent'; -import { Text } from '../Text'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; import { ArrowFromAgendaItemComponent } from './ArrowFromAgendaItemComponent'; import { ArrowFromArrayUnit } from './ArrowFromArrayUnit'; import { ArrowFromFn } from './ArrowFromFn'; diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromAgendaItemComponent.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromAgendaItemComponent.tsx index 512ca67f17..ae275eb5f3 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromAgendaItemComponent.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromAgendaItemComponent.tsx @@ -1,9 +1,10 @@ -import { FnValue } from '../../components/values/FnValue'; -import { GlobalFnValue } from '../../components/values/GlobalFnValue'; -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { AgendaItemComponent } from '../AgendaItemComponent'; -import { Frame } from '../Frame'; +import { AgendaItemComponent } from 'src/features/envVisualizer/compactComponents/AgendaItemComponent'; +import { Frame } from 'src/features/envVisualizer/compactComponents/Frame'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromArrayUnit.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromArrayUnit.tsx index cc0c33c640..acb3dc6491 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromArrayUnit.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromArrayUnit.tsx @@ -1,10 +1,11 @@ -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { ArrayUnit } from '../ArrayUnit'; -import { ArrayValue } from '../values/ArrayValue'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; -import { Value } from '../values/Value'; +import { ArrayUnit } from 'src/features/envVisualizer/compactComponents/ArrayUnit'; +import { ArrayValue } from 'src/features/envVisualizer/compactComponents/values/ArrayValue'; +import { FnValue } from 'src/features/envVisualizer/compactComponents/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/compactComponents/values/GlobalFnValue'; +import { Value } from 'src/features/envVisualizer/compactComponents/values/Value'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromFn.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromFn.tsx index 345fa03a40..56e76b90ee 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromFn.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromFn.tsx @@ -1,8 +1,9 @@ -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { Frame } from '../Frame'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; +import { Frame } from 'src/features/envVisualizer/compactComponents/Frame'; +import { FnValue } from 'src/features/envVisualizer/compactComponents/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/compactComponents/values/GlobalFnValue'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromFrame.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromFrame.tsx index 3e4f04a47f..fa6398d8ae 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromFrame.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromFrame.tsx @@ -1,6 +1,7 @@ -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { Frame } from '../Frame'; +import { Frame } from 'src/features/envVisualizer/compactComponents/Frame'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromStashItemComponent.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromStashItemComponent.tsx index 33487ca419..512f2db10d 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromStashItemComponent.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromStashItemComponent.tsx @@ -1,10 +1,11 @@ -import { FnValue } from '../../components/values/FnValue'; -import { GlobalFnValue } from '../../components/values/GlobalFnValue'; -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { Frame } from '../Frame'; -import { StashItemComponent } from '../StashItemComponent'; -import { ArrayValue } from '../values/ArrayValue'; +import { Frame } from 'src/features/envVisualizer/compactComponents/Frame'; +import { StashItemComponent } from 'src/features/envVisualizer/compactComponents/StashItemComponent'; +import { ArrayValue } from 'src/features/envVisualizer/compactComponents/values/ArrayValue'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/ArrowFromText.tsx b/src/features/envVisualizer/compactComponents/arrows/ArrowFromText.tsx index 6805252c1e..ad86b82843 100644 --- a/src/features/envVisualizer/compactComponents/arrows/ArrowFromText.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/ArrowFromText.tsx @@ -1,8 +1,9 @@ -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { Text } from '../Text'; -import { ArrayValue } from '../values/ArrayValue'; -import { Value } from '../values/Value'; +import { Text } from 'src/features/envVisualizer/compactComponents/Text'; +import { ArrayValue } from 'src/features/envVisualizer/compactComponents/values/ArrayValue'; +import { Value } from 'src/features/envVisualizer/compactComponents/values/Value'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/compactComponents/arrows/GenericArrow.tsx b/src/features/envVisualizer/compactComponents/arrows/GenericArrow.tsx index 8c1d9b6049..a18d8f64c3 100644 --- a/src/features/envVisualizer/compactComponents/arrows/GenericArrow.tsx +++ b/src/features/envVisualizer/compactComponents/arrows/GenericArrow.tsx @@ -1,10 +1,12 @@ import { Arrow as KonvaArrow, Group as KonvaGroup, Path as KonvaPath } from 'react-konva'; - -import { Visible } from '../../components/Visible'; -import { CompactConfig, ShapeDefaultProps } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { IVisible, StepsArray } from '../../EnvVisualizerTypes'; -import { defaultSAColor } from '../../EnvVisualizerUtils'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IVisible, StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { defaultSAColor } from 'src/features/envVisualizer/EnvVisualizerUtils'; /** this class encapsulates an arrow to be drawn between 2 points */ export class GenericArrow extends Visible { diff --git a/src/features/envVisualizer/compactComponents/values/ArrayValue.tsx b/src/features/envVisualizer/compactComponents/values/ArrayValue.tsx index ae4a455797..95094d5535 100644 --- a/src/features/envVisualizer/compactComponents/values/ArrayValue.tsx +++ b/src/features/envVisualizer/compactComponents/values/ArrayValue.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import { ArrayEmptyUnit } from 'src/features/envVisualizer/compactComponents/ArrayEmptyUnit'; +import { ArrayUnit } from 'src/features/envVisualizer/compactComponents/ArrayUnit'; +import { Binding } from 'src/features/envVisualizer/compactComponents/Binding'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { CompactReferenceType, Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { CompactReferenceType, Data } from '../../EnvVisualizerTypes'; -import { ArrayEmptyUnit } from '../ArrayEmptyUnit'; -import { ArrayUnit } from '../ArrayUnit'; -import { Binding } from '../Binding'; import { PrimitiveValue } from './PrimitiveValue'; import { Value } from './Value'; diff --git a/src/features/envVisualizer/compactComponents/values/FnValue.tsx b/src/features/envVisualizer/compactComponents/values/FnValue.tsx index 53dc14e9c1..c5a2e87065 100644 --- a/src/features/envVisualizer/compactComponents/values/FnValue.tsx +++ b/src/features/envVisualizer/compactComponents/values/FnValue.tsx @@ -8,20 +8,28 @@ import { Tag as KonvaTag, Text as KonvaText } from 'react-konva'; - -import EnvVisualizer from '../../EnvVisualizer'; -import { CompactConfig, ShapeDefaultProps } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { CompactReferenceType, EnvTreeNode, FnTypes, IHoverable } from '../../EnvVisualizerTypes'; +import { ArrowFromFn } from 'src/features/envVisualizer/compactComponents/arrows/ArrowFromFn'; +import { Binding } from 'src/features/envVisualizer/compactComponents/Binding'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { + CompactReferenceType, + EnvTreeNode, + FnTypes, + IHoverable +} from 'src/features/envVisualizer/EnvVisualizerTypes'; import { defaultSAColor, getBodyText, getNonEmptyEnv, getParamsText, getTextWidth -} from '../../EnvVisualizerUtils'; -import { ArrowFromFn } from '../arrows/ArrowFromFn'; -import { Binding } from '../Binding'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { Value } from './Value'; /** this class encapsulates a JS Slang function (not from the global frame) that diff --git a/src/features/envVisualizer/compactComponents/values/GlobalFnValue.tsx b/src/features/envVisualizer/compactComponents/values/GlobalFnValue.tsx index 4310f4513b..dbcfbc0576 100644 --- a/src/features/envVisualizer/compactComponents/values/GlobalFnValue.tsx +++ b/src/features/envVisualizer/compactComponents/values/GlobalFnValue.tsx @@ -7,14 +7,22 @@ import { Tag as KonvaTag, Text as KonvaText } from 'react-konva'; +import { ArrowFromFn } from 'src/features/envVisualizer/compactComponents/arrows/ArrowFromFn'; +import { Binding } from 'src/features/envVisualizer/compactComponents/Binding'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { + CompactConfig, + ShapeDefaultProps +} from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { CompactReferenceType, IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { + defaultSAColor, + getBodyText, + getParamsText, + getTextWidth +} from 'src/features/envVisualizer/EnvVisualizerUtils'; -import EnvVisualizer from '../../EnvVisualizer'; -import { CompactConfig, ShapeDefaultProps } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { CompactReferenceType, IHoverable } from '../../EnvVisualizerTypes'; -import { defaultSAColor, getBodyText, getParamsText, getTextWidth } from '../../EnvVisualizerUtils'; -import { ArrowFromFn } from '../arrows/ArrowFromFn'; -import { Binding } from '../Binding'; import { Value } from './Value'; /** this encapsulates a function from the global frame diff --git a/src/features/envVisualizer/compactComponents/values/PrimitiveValue.tsx b/src/features/envVisualizer/compactComponents/values/PrimitiveValue.tsx index 0a878b926f..15cad0927d 100644 --- a/src/features/envVisualizer/compactComponents/values/PrimitiveValue.tsx +++ b/src/features/envVisualizer/compactComponents/values/PrimitiveValue.tsx @@ -1,12 +1,15 @@ import React from 'react'; +import { ArrayNullUnit } from 'src/features/envVisualizer/compactComponents/ArrayNullUnit'; +import { Binding } from 'src/features/envVisualizer/compactComponents/Binding'; +import { Text } from 'src/features/envVisualizer/compactComponents/Text'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { + CompactReferenceType, + PrimitiveTypes +} from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getTextWidth, isNull } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { CompactReferenceType, PrimitiveTypes } from '../../EnvVisualizerTypes'; -import { getTextWidth, isNull } from '../../EnvVisualizerUtils'; -import { ArrayNullUnit } from '../ArrayNullUnit'; -import { Binding } from '../Binding'; -import { Text } from '../Text'; import { Value } from './Value'; /** this classes encapsulates a primitive value in Source: number, string or null */ diff --git a/src/features/envVisualizer/compactComponents/values/UnassignedValue.tsx b/src/features/envVisualizer/compactComponents/values/UnassignedValue.tsx index 5223fa759c..4abc8362e9 100644 --- a/src/features/envVisualizer/compactComponents/values/UnassignedValue.tsx +++ b/src/features/envVisualizer/compactComponents/values/UnassignedValue.tsx @@ -1,11 +1,14 @@ import React from 'react'; +import { Binding } from 'src/features/envVisualizer/compactComponents/Binding'; +import { Text } from 'src/features/envVisualizer/compactComponents/Text'; +import { CompactConfig } from 'src/features/envVisualizer/EnvVisualizerCompactConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { + CompactReferenceType, + UnassignedData +} from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getTextWidth } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { CompactConfig } from '../../EnvVisualizerCompactConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { CompactReferenceType, UnassignedData } from '../../EnvVisualizerTypes'; -import { getTextWidth } from '../../EnvVisualizerUtils'; -import { Binding } from '../Binding'; -import { Text } from '../Text'; import { Value } from './Value'; /** this class encapsulates an unassigned value in Source, internally represented as a symbol */ diff --git a/src/features/envVisualizer/compactComponents/values/Value.tsx b/src/features/envVisualizer/compactComponents/values/Value.tsx index db19dddc06..2a38da4ebf 100644 --- a/src/features/envVisualizer/compactComponents/values/Value.tsx +++ b/src/features/envVisualizer/compactComponents/values/Value.tsx @@ -1,7 +1,6 @@ import React from 'react'; - -import { Visible } from '../../components/Visible'; -import { CompactReferenceType, Data } from '../../EnvVisualizerTypes'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { CompactReferenceType, Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; /** the value of a `Binding` or an `ArrayUnit` */ export abstract class Value extends Visible { diff --git a/src/features/envVisualizer/components/ArrayEmptyUnit.tsx b/src/features/envVisualizer/components/ArrayEmptyUnit.tsx index 9bc8f37663..ff9610bddb 100644 --- a/src/features/envVisualizer/components/ArrayEmptyUnit.tsx +++ b/src/features/envVisualizer/components/ArrayEmptyUnit.tsx @@ -1,10 +1,10 @@ import React, { RefObject } from 'react'; import { Rect } from 'react-konva'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import EnvVisualizer from '../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; import { ArrayValue } from './values/ArrayValue'; import { Visible } from './Visible'; diff --git a/src/features/envVisualizer/components/ArrayLevel.tsx b/src/features/envVisualizer/components/ArrayLevel.tsx index aa6b2dd049..aa236824e0 100644 --- a/src/features/envVisualizer/components/ArrayLevel.tsx +++ b/src/features/envVisualizer/components/ArrayLevel.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { Group, Rect } from 'react-konva'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; import { FrameLevel } from './FrameLevel'; import { Level } from './Level'; import { ArrayValue } from './values/ArrayValue'; diff --git a/src/features/envVisualizer/components/ArrayNullUnit.tsx b/src/features/envVisualizer/components/ArrayNullUnit.tsx index 561bdece31..6f51812b09 100644 --- a/src/features/envVisualizer/components/ArrayNullUnit.tsx +++ b/src/features/envVisualizer/components/ArrayNullUnit.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { Line as KonvaLine } from 'react-konva'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import EnvVisualizer from '../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { ReferenceType } from '../EnvVisualizerTypes'; import { Visible } from './Visible'; /** this classes encapsulates a null value in Source pairs or arrays */ diff --git a/src/features/envVisualizer/components/ArrayUnit.tsx b/src/features/envVisualizer/components/ArrayUnit.tsx index d4cbf987d5..fa02064208 100644 --- a/src/features/envVisualizer/components/ArrayUnit.tsx +++ b/src/features/envVisualizer/components/ArrayUnit.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import EnvVisualizer from '../EnvVisualizer'; -import { Config } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; import { ArrowFromArrayUnit } from './arrows/ArrowFromArrayUnit'; import { GenericArrow } from './arrows/GenericArrow'; import { RoundedRect } from './shapes/RoundedRect'; diff --git a/src/features/envVisualizer/components/ArrowLane.tsx b/src/features/envVisualizer/components/ArrowLane.tsx index fd934ece17..a2e008b9aa 100644 --- a/src/features/envVisualizer/components/ArrowLane.tsx +++ b/src/features/envVisualizer/components/ArrowLane.tsx @@ -1,5 +1,6 @@ -import { Config } from '../EnvVisualizerConfig'; -import { Data, IVisible } from '../EnvVisualizerTypes'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Data, IVisible } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { Frame } from './Frame'; import { Grid } from './Grid'; import { Value } from './values/Value'; diff --git a/src/features/envVisualizer/components/Binding.tsx b/src/features/envVisualizer/components/Binding.tsx index 3a781f37a9..4eb4fca787 100644 --- a/src/features/envVisualizer/components/Binding.tsx +++ b/src/features/envVisualizer/components/Binding.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { isDummyKey, isMainReference } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import EnvVisualizer from '../EnvVisualizer'; -import { Config } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data } from '../EnvVisualizerTypes'; -import { isDummyKey, isMainReference } from '../EnvVisualizerUtils'; import { ArrowFromText } from './arrows/ArrowFromText'; import { GenericArrow } from './arrows/GenericArrow'; import { Frame } from './Frame'; diff --git a/src/features/envVisualizer/components/Frame.tsx b/src/features/envVisualizer/components/Frame.tsx index 98581cd26f..48d00b7f89 100644 --- a/src/features/envVisualizer/components/Frame.tsx +++ b/src/features/envVisualizer/components/Frame.tsx @@ -1,18 +1,18 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; import { Group, Rect } from 'react-konva'; - -import EnvVisualizer from '../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Env, EnvTreeNode, IHoverable } from '../EnvVisualizerTypes'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Env, EnvTreeNode, IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; import { getNonEmptyEnv, getTextWidth, isDummyKey, isPrimitiveData, isUnassigned -} from '../EnvVisualizerUtils'; +} from 'src/features/envVisualizer/EnvVisualizerUtils'; + import { ArrowFromFrame } from './arrows/ArrowFromFrame'; import { GenericArrow } from './arrows/GenericArrow'; import { Binding } from './Binding'; diff --git a/src/features/envVisualizer/components/FrameLevel.tsx b/src/features/envVisualizer/components/FrameLevel.tsx index 37db4a06a9..8a43aa2f5e 100644 --- a/src/features/envVisualizer/components/FrameLevel.tsx +++ b/src/features/envVisualizer/components/FrameLevel.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Group, Rect } from 'react-konva'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { EnvTreeNode } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { EnvTreeNode } from '../EnvVisualizerTypes'; import { ArrayLevel } from './ArrayLevel'; import { Frame } from './Frame'; import { Level } from './Level'; diff --git a/src/features/envVisualizer/components/Grid.tsx b/src/features/envVisualizer/components/Grid.tsx index 0da6255e99..97af01af2d 100644 --- a/src/features/envVisualizer/components/Grid.tsx +++ b/src/features/envVisualizer/components/Grid.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { Group, Rect } from 'react-konva'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { EnvTreeNode } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getNextChildren } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { EnvTreeNode } from '../EnvVisualizerTypes'; -import { getNextChildren } from '../EnvVisualizerUtils'; import { ArrayLevel } from './ArrayLevel'; import { ArrayUnit } from './ArrayUnit'; import { ArrowLane } from './ArrowLane'; diff --git a/src/features/envVisualizer/components/Text.tsx b/src/features/envVisualizer/components/Text.tsx index 19aca904fb..eb50063d64 100644 --- a/src/features/envVisualizer/components/Text.tsx +++ b/src/features/envVisualizer/components/Text.tsx @@ -1,12 +1,16 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; import { Group, Label as KonvaLabel, Tag as KonvaTag, Text as KonvaText } from 'react-konva'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data, IHoverable } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { + getTextWidth, + setHoveredCursor, + setUnhoveredCursor +} from 'src/features/envVisualizer/EnvVisualizerUtils'; -import EnvVisualizer from '../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../EnvVisualizerConfig'; -import { Layout } from '../EnvVisualizerLayout'; -import { Data, IHoverable } from '../EnvVisualizerTypes'; -import { getTextWidth, setHoveredCursor, setUnhoveredCursor } from '../EnvVisualizerUtils'; import { Frame } from './Frame'; import { Visible } from './Visible'; diff --git a/src/features/envVisualizer/components/Visible.tsx b/src/features/envVisualizer/components/Visible.tsx index e78a7777af..bc5b9e68c8 100644 --- a/src/features/envVisualizer/components/Visible.tsx +++ b/src/features/envVisualizer/components/Visible.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { RefObject } from 'react'; - -import { IVisible } from '../EnvVisualizerTypes'; +import { IVisible } from 'src/features/envVisualizer/EnvVisualizerTypes'; /** * class to implement the IVisible interface, used by both compact and non-compact components. diff --git a/src/features/envVisualizer/components/arrows/Arrow.tsx b/src/features/envVisualizer/components/arrows/Arrow.tsx index 65096acd37..b6e9b99427 100644 --- a/src/features/envVisualizer/components/arrows/Arrow.tsx +++ b/src/features/envVisualizer/components/arrows/Arrow.tsx @@ -1,12 +1,12 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React, { RefObject } from 'react'; +import { ArrayUnit } from 'src/features/envVisualizer/components/ArrayUnit'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; -import { ArrayUnit } from '../ArrayUnit'; -import { Frame } from '../Frame'; -import { Text } from '../Text'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; -import { Visible } from '../Visible'; import { ArrowFromArrayUnit } from './ArrowFromArrayUnit'; import { ArrowFromFn } from './ArrowFromFn'; import { ArrowFromFrame } from './ArrowFromFrame'; diff --git a/src/features/envVisualizer/components/arrows/ArrowFromArrayUnit.tsx b/src/features/envVisualizer/components/arrows/ArrowFromArrayUnit.tsx index 8cf03ebe43..3b9e886803 100644 --- a/src/features/envVisualizer/components/arrows/ArrowFromArrayUnit.tsx +++ b/src/features/envVisualizer/components/arrows/ArrowFromArrayUnit.tsx @@ -1,11 +1,12 @@ -import { Config } from '../../EnvVisualizerConfig'; -import { IVisible, StepsArray } from '../../EnvVisualizerTypes'; -import { ArrayUnit } from '../ArrayUnit'; -import { ArrowLane } from '../ArrowLane'; -import { ArrayValue } from '../values/ArrayValue'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; -import { Value } from '../values/Value'; +import { ArrayUnit } from 'src/features/envVisualizer/components/ArrayUnit'; +import { ArrowLane } from 'src/features/envVisualizer/components/ArrowLane'; +import { ArrayValue } from 'src/features/envVisualizer/components/values/ArrayValue'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { Value } from 'src/features/envVisualizer/components/values/Value'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { IVisible, StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/components/arrows/ArrowFromFn.tsx b/src/features/envVisualizer/components/arrows/ArrowFromFn.tsx index fbc4cd534c..d6a0202a20 100644 --- a/src/features/envVisualizer/components/arrows/ArrowFromFn.tsx +++ b/src/features/envVisualizer/components/arrows/ArrowFromFn.tsx @@ -1,9 +1,10 @@ -import { Config } from '../../EnvVisualizerConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { ArrowLane } from '../ArrowLane'; -import { Frame } from '../Frame'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; +import { ArrowLane } from 'src/features/envVisualizer/components/ArrowLane'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/components/arrows/ArrowFromFrame.tsx b/src/features/envVisualizer/components/arrows/ArrowFromFrame.tsx index 667d16ff59..2b33c92660 100644 --- a/src/features/envVisualizer/components/arrows/ArrowFromFrame.tsx +++ b/src/features/envVisualizer/components/arrows/ArrowFromFrame.tsx @@ -1,9 +1,9 @@ import { KonvaEventObject } from 'konva/lib/Node'; +import { ArrowLane } from 'src/features/envVisualizer/components/ArrowLane'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; -import { Config } from '../../EnvVisualizerConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { ArrowLane } from '../ArrowLane'; -import { Frame } from '../Frame'; import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/components/arrows/ArrowFromText.tsx b/src/features/envVisualizer/components/arrows/ArrowFromText.tsx index 6c6523b1b1..26fc811b75 100644 --- a/src/features/envVisualizer/components/arrows/ArrowFromText.tsx +++ b/src/features/envVisualizer/components/arrows/ArrowFromText.tsx @@ -1,13 +1,14 @@ -import { Config } from '../../EnvVisualizerConfig'; -import { StepsArray } from '../../EnvVisualizerTypes'; -import { ArrowLane } from '../ArrowLane'; -import { Frame } from '../Frame'; -import { Grid } from '../Grid'; -import { Text } from '../Text'; -import { ArrayValue } from '../values/ArrayValue'; -import { FnValue } from '../values/FnValue'; -import { GlobalFnValue } from '../values/GlobalFnValue'; -import { Value } from '../values/Value'; +import { ArrowLane } from 'src/features/envVisualizer/components/ArrowLane'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import { Grid } from 'src/features/envVisualizer/components/Grid'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { ArrayValue } from 'src/features/envVisualizer/components/values/ArrayValue'; +import { FnValue } from 'src/features/envVisualizer/components/values/FnValue'; +import { GlobalFnValue } from 'src/features/envVisualizer/components/values/GlobalFnValue'; +import { Value } from 'src/features/envVisualizer/components/values/Value'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; + import { GenericArrow } from './GenericArrow'; /** this class encapsulates an GenericArrow to be drawn between 2 points */ diff --git a/src/features/envVisualizer/components/arrows/GenericArrow.tsx b/src/features/envVisualizer/components/arrows/GenericArrow.tsx index 4a43f52027..aa709db843 100644 --- a/src/features/envVisualizer/components/arrows/GenericArrow.tsx +++ b/src/features/envVisualizer/components/arrows/GenericArrow.tsx @@ -1,13 +1,12 @@ import { KonvaEventObject } from 'konva/lib/Node'; import { Arrow as KonvaArrow, Group as KonvaGroup, Path as KonvaPath } from 'react-konva'; - -import EnvVisualizer from '../../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { IHoverable, IVisible, StepsArray } from '../../EnvVisualizerTypes'; -import { Frame } from '../Frame'; -import { Text } from '../Text'; -import { Visible } from '../Visible'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { IHoverable, IVisible, StepsArray } from 'src/features/envVisualizer/EnvVisualizerTypes'; /** this class encapsulates an arrow to be drawn between 2 points */ export class GenericArrow diff --git a/src/features/envVisualizer/components/shapes/RoundedRect.tsx b/src/features/envVisualizer/components/shapes/RoundedRect.tsx index 43c5eabae1..9b84e147f5 100644 --- a/src/features/envVisualizer/components/shapes/RoundedRect.tsx +++ b/src/features/envVisualizer/components/shapes/RoundedRect.tsx @@ -1,8 +1,7 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React, { RefObject } from 'react'; import { Shape } from 'react-konva'; - -import { ShapeDefaultProps } from '../../EnvVisualizerConfig'; +import { ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; interface Props { x: number; diff --git a/src/features/envVisualizer/components/values/ArrayValue.tsx b/src/features/envVisualizer/components/values/ArrayValue.tsx index 8e0db11dbf..21bd254322 100644 --- a/src/features/envVisualizer/components/values/ArrayValue.tsx +++ b/src/features/envVisualizer/components/values/ArrayValue.tsx @@ -1,17 +1,17 @@ import React, { RefObject } from 'react'; import { Group, Rect } from 'react-konva'; +import { ArrayEmptyUnit } from 'src/features/envVisualizer/components/ArrayEmptyUnit'; +import { ArrayLevel } from 'src/features/envVisualizer/components/ArrayLevel'; +import { ArrayUnit } from 'src/features/envVisualizer/components/ArrayUnit'; +import { ArrowFromText } from 'src/features/envVisualizer/components/arrows/ArrowFromText'; +import { GenericArrow } from 'src/features/envVisualizer/components/arrows/GenericArrow'; +import { Binding } from 'src/features/envVisualizer/components/Binding'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { Data, ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { setUnhoveredStyle } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Config } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { Data, ReferenceType } from '../../EnvVisualizerTypes'; -import { setUnhoveredStyle } from '../../EnvVisualizerUtils'; -import { ArrayEmptyUnit } from '../ArrayEmptyUnit'; -import { ArrayLevel } from '../ArrayLevel'; -import { ArrayUnit } from '../ArrayUnit'; -import { ArrowFromText } from '../arrows/ArrowFromText'; -import { GenericArrow } from '../arrows/GenericArrow'; -import { Binding } from '../Binding'; -import { Text } from '../Text'; import { Value } from './Value'; /** this class encapsulates an array value in source, diff --git a/src/features/envVisualizer/components/values/FnValue.tsx b/src/features/envVisualizer/components/values/FnValue.tsx index 37d9397b55..70946cc47f 100644 --- a/src/features/envVisualizer/components/values/FnValue.tsx +++ b/src/features/envVisualizer/components/values/FnValue.tsx @@ -8,16 +8,26 @@ import { Tag as KonvaTag, Text as KonvaText } from 'react-konva'; +import { ArrowFromFn } from 'src/features/envVisualizer/components/arrows/ArrowFromFn'; +import { GenericArrow } from 'src/features/envVisualizer/components/arrows/GenericArrow'; +import { Binding } from 'src/features/envVisualizer/components/Binding'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { + EnvTreeNode, + FnTypes, + IHoverable, + ReferenceType +} from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { + getBodyText, + getNonEmptyEnv, + getParamsText, + getTextWidth +} from 'src/features/envVisualizer/EnvVisualizerUtils'; -import EnvVisualizer from '../../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { EnvTreeNode, FnTypes, IHoverable, ReferenceType } from '../../EnvVisualizerTypes'; -import { getBodyText, getNonEmptyEnv, getParamsText, getTextWidth } from '../../EnvVisualizerUtils'; -import { ArrowFromFn } from '../arrows/ArrowFromFn'; -import { GenericArrow } from '../arrows/GenericArrow'; -import { Binding } from '../Binding'; -import { Frame } from '../Frame'; import { GlobalFnValue } from './GlobalFnValue'; import { Value } from './Value'; diff --git a/src/features/envVisualizer/components/values/GlobalFnValue.tsx b/src/features/envVisualizer/components/values/GlobalFnValue.tsx index 100bd244ae..1ac35c2c37 100644 --- a/src/features/envVisualizer/components/values/GlobalFnValue.tsx +++ b/src/features/envVisualizer/components/values/GlobalFnValue.tsx @@ -7,16 +7,20 @@ import { Tag as KonvaTag, Text as KonvaText } from 'react-konva'; +import { ArrowFromFn } from 'src/features/envVisualizer/components/arrows/ArrowFromFn'; +import { GenericArrow } from 'src/features/envVisualizer/components/arrows/GenericArrow'; +import { Binding } from 'src/features/envVisualizer/components/Binding'; +import { Frame } from 'src/features/envVisualizer/components/Frame'; +import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { Config, ShapeDefaultProps } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { + getBodyText, + getParamsText, + getTextWidth +} from 'src/features/envVisualizer/EnvVisualizerUtils'; -import EnvVisualizer from '../../EnvVisualizer'; -import { Config, ShapeDefaultProps } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { ReferenceType } from '../../EnvVisualizerTypes'; -import { getBodyText, getParamsText, getTextWidth } from '../../EnvVisualizerUtils'; -import { ArrowFromFn } from '../arrows/ArrowFromFn'; -import { GenericArrow } from '../arrows/GenericArrow'; -import { Binding } from '../Binding'; -import { Frame } from '../Frame'; import { FnValue } from './FnValue'; import { Value } from './Value'; diff --git a/src/features/envVisualizer/components/values/PrimitiveValue.tsx b/src/features/envVisualizer/components/values/PrimitiveValue.tsx index cbc25cd7d7..8b38a53a11 100644 --- a/src/features/envVisualizer/components/values/PrimitiveValue.tsx +++ b/src/features/envVisualizer/components/values/PrimitiveValue.tsx @@ -1,12 +1,12 @@ import React from 'react'; +import { ArrayNullUnit } from 'src/features/envVisualizer/components/ArrayNullUnit'; +import { Binding } from 'src/features/envVisualizer/components/Binding'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { PrimitiveTypes, ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getTextWidth, isNull } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Config } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { PrimitiveTypes, ReferenceType } from '../../EnvVisualizerTypes'; -import { getTextWidth, isNull } from '../../EnvVisualizerUtils'; -import { ArrayNullUnit } from '../ArrayNullUnit'; -import { Binding } from '../Binding'; -import { Text } from '../Text'; import { Value } from './Value'; /** this classes encapsulates a primitive value in Source: number, string or null */ diff --git a/src/features/envVisualizer/components/values/UnassignedValue.tsx b/src/features/envVisualizer/components/values/UnassignedValue.tsx index 00762f8695..fcf564cdc1 100644 --- a/src/features/envVisualizer/components/values/UnassignedValue.tsx +++ b/src/features/envVisualizer/components/values/UnassignedValue.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import { Binding } from 'src/features/envVisualizer/components/Binding'; +import { Text } from 'src/features/envVisualizer/components/Text'; +import { Config } from 'src/features/envVisualizer/EnvVisualizerConfig'; +import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout'; +import { ReferenceType, UnassignedData } from 'src/features/envVisualizer/EnvVisualizerTypes'; +import { getTextWidth } from 'src/features/envVisualizer/EnvVisualizerUtils'; -import { Config } from '../../EnvVisualizerConfig'; -import { Layout } from '../../EnvVisualizerLayout'; -import { ReferenceType, UnassignedData } from '../../EnvVisualizerTypes'; -import { getTextWidth } from '../../EnvVisualizerUtils'; -import { Binding } from '../Binding'; -import { Text } from '../Text'; import { Value } from './Value'; /** this class encapsulates an unassigned value in Source, internally represented as a symbol */ diff --git a/src/features/envVisualizer/components/values/Value.tsx b/src/features/envVisualizer/components/values/Value.tsx index 9681fb09a1..7bf513f4bd 100644 --- a/src/features/envVisualizer/components/values/Value.tsx +++ b/src/features/envVisualizer/components/values/Value.tsx @@ -1,8 +1,7 @@ import { KonvaEventObject } from 'konva/lib/Node'; import React from 'react'; - -import { Data, IHoverable, ReferenceType } from '../../EnvVisualizerTypes'; -import { Visible } from '../Visible'; +import { Visible } from 'src/features/envVisualizer/components/Visible'; +import { Data, IHoverable, ReferenceType } from 'src/features/envVisualizer/EnvVisualizerTypes'; /** the value of a `Binding` or an `ArrayUnit` */ export abstract class Value extends Visible implements IHoverable { diff --git a/src/features/eventLogging/index.ts b/src/features/eventLogging/index.ts index 6be1799bfc..6d894ff32a 100644 --- a/src/features/eventLogging/index.ts +++ b/src/features/eventLogging/index.ts @@ -1,9 +1,8 @@ import { Chapter } from 'js-slang/dist/types'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { Input as RecorderInput } from 'src/features/sourceRecorder/SourceRecorderTypes'; import { v4 as uuid } from 'uuid'; -import { ExternalLibraryName } from '../../commons/application/types/ExternalTypes'; -import { Input as RecorderInput } from '../sourceRecorder/SourceRecorderTypes'; - export const playgroundQuestionId: number = -1; type PlaybackInitial = { diff --git a/src/features/game/SourceAcademyGame.ts b/src/features/game/SourceAcademyGame.ts index f18cc9e60e..ae136cbc0a 100644 --- a/src/features/game/SourceAcademyGame.ts +++ b/src/features/game/SourceAcademyGame.ts @@ -1,4 +1,5 @@ import * as Phaser from 'phaser'; +import { AchievementGoal, AchievementItem } from 'src/features/achievement/AchievementTypes'; import { AwardProperty } from 'src/features/game/awards/GameAwardsTypes'; import { Constants, screenSize } from 'src/features/game/commons/CommonConstants'; import { AssetPath, ItemId } from 'src/features/game/commons/CommonTypes'; @@ -15,7 +16,6 @@ import GameSoundManager from 'src/features/game/sound/GameSoundManager'; import { mandatory } from 'src/features/game/utils/GameUtils'; import { StorySimState } from 'src/features/storySimulator/StorySimulatorTypes'; -import { AchievementGoal, AchievementItem } from '../achievement/AchievementTypes'; import { fetchGameChapters } from './chapter/GameChapterHelpers'; import GameChapterMocks from './chapter/GameChapterMocks'; import { GameChapter } from './chapter/GameChapterTypes'; diff --git a/src/features/game/action/GameActionConditionChecker.ts b/src/features/game/action/GameActionConditionChecker.ts index f76f1e4a0f..6ec1b30cc7 100644 --- a/src/features/game/action/GameActionConditionChecker.ts +++ b/src/features/game/action/GameActionConditionChecker.ts @@ -1,5 +1,6 @@ -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { GameStateStorage } from '../state/GameStateTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { GameStateStorage } from 'src/features/game/state/GameStateTypes'; + import { ActionCondition } from './GameActionTypes'; /** diff --git a/src/features/game/action/GameActionExecuter.ts b/src/features/game/action/GameActionExecuter.ts index 717b5645ad..4f55e77df9 100644 --- a/src/features/game/action/GameActionExecuter.ts +++ b/src/features/game/action/GameActionExecuter.ts @@ -1,8 +1,9 @@ -import { Layer } from '../layer/GameLayerTypes'; -import { GamePhaseType } from '../phase/GamePhaseTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { sleep } from '../utils/GameUtils'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { sleep } from 'src/features/game/utils/GameUtils'; + import { GameActionType } from './GameActionTypes'; /** diff --git a/src/features/game/action/GameActionManager.ts b/src/features/game/action/GameActionManager.ts index a630130101..e2cc9a6fa2 100644 --- a/src/features/game/action/GameActionManager.ts +++ b/src/features/game/action/GameActionManager.ts @@ -1,5 +1,6 @@ -import { ItemId } from '../commons/CommonTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; + import ActionConditionChecker from './GameActionConditionChecker'; import GameActionExecuter from './GameActionExecuter'; import { ActionCondition } from './GameActionTypes'; diff --git a/src/features/game/action/GameActionTypes.ts b/src/features/game/action/GameActionTypes.ts index fcc2d9d0f3..a581783b30 100644 --- a/src/features/game/action/GameActionTypes.ts +++ b/src/features/game/action/GameActionTypes.ts @@ -1,5 +1,5 @@ -import { ItemId, TrackInteraction } from '../commons/CommonTypes'; -import { GameStateStorage } from '../state/GameStateTypes'; +import { ItemId, TrackInteraction } from 'src/features/game/commons/CommonTypes'; +import { GameStateStorage } from 'src/features/game/state/GameStateTypes'; export enum GameActionType { MoveCharacter = 'MoveCharacter', diff --git a/src/features/game/animations/GameAnimationManager.ts b/src/features/game/animations/GameAnimationManager.ts index 91a2d17a62..ebb0aee497 100644 --- a/src/features/game/animations/GameAnimationManager.ts +++ b/src/features/game/animations/GameAnimationManager.ts @@ -1,8 +1,8 @@ -import { AnimType, AssetType, ImageAsset } from '../assets/AssetsTypes'; -import { AssetKey } from '../commons/CommonTypes'; -import { GameItemType } from '../location/GameMapTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { mandatory } from '../utils/GameUtils'; +import { AnimType, AssetType, ImageAsset } from 'src/features/game/assets/AssetsTypes'; +import { AssetKey } from 'src/features/game/commons/CommonTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { mandatory } from 'src/features/game/utils/GameUtils'; /** * Manager for game animations. diff --git a/src/features/game/assets/AssetsTypes.ts b/src/features/game/assets/AssetsTypes.ts index b4cc6058ab..adeb41126d 100644 --- a/src/features/game/assets/AssetsTypes.ts +++ b/src/features/game/assets/AssetsTypes.ts @@ -1,5 +1,5 @@ -import { AssetKey, AssetPath } from '../commons/CommonTypes'; -import { GameSoundType } from '../sound/GameSoundTypes'; +import { AssetKey, AssetPath } from 'src/features/game/commons/CommonTypes'; +import { GameSoundType } from 'src/features/game/sound/GameSoundTypes'; export type AssetMap = { [name: string]: T; diff --git a/src/features/game/assets/SoundAssets.ts b/src/features/game/assets/SoundAssets.ts index f903f5b143..394ed552f4 100644 --- a/src/features/game/assets/SoundAssets.ts +++ b/src/features/game/assets/SoundAssets.ts @@ -1,4 +1,5 @@ -import { GameSoundType } from '../sound/GameSoundTypes'; +import { GameSoundType } from 'src/features/game/sound/GameSoundTypes'; + import { AssetMap, SoundAsset } from './AssetsTypes'; const SoundAssets: AssetMap = { diff --git a/src/features/game/assets/TextAssets.ts b/src/features/game/assets/TextAssets.ts index c0848d9f02..4eb03eb8c1 100644 --- a/src/features/game/assets/TextAssets.ts +++ b/src/features/game/assets/TextAssets.ts @@ -1,4 +1,4 @@ -import { toS3Path } from '../utils/GameUtils'; +import { toS3Path } from 'src/features/game/utils/GameUtils'; export const toTxtPath = (path: string) => toS3Path(`/stories/${path}`, true); diff --git a/src/features/game/awards/GameAwardsConstants.ts b/src/features/game/awards/GameAwardsConstants.ts index a6891328ec..fd77e2e4f4 100644 --- a/src/features/game/awards/GameAwardsConstants.ts +++ b/src/features/game/awards/GameAwardsConstants.ts @@ -1,7 +1,8 @@ -import FontAssets from '../assets/FontAssets'; -import { Constants, screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; -import { Color } from '../utils/StyleUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { Constants, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; +import { Color } from 'src/features/game/utils/StyleUtils'; + import { AwardProperty } from './GameAwardsTypes'; export const listBannerTextStyle: BitmapFontStyle = { diff --git a/src/features/game/awards/GameAwardsHelper.ts b/src/features/game/awards/GameAwardsHelper.ts index 674d8f5dd9..a0340d7ba8 100644 --- a/src/features/game/awards/GameAwardsHelper.ts +++ b/src/features/game/awards/GameAwardsHelper.ts @@ -1,8 +1,9 @@ -import CommonTextHover from '../commons/CommonTextHover'; -import { ItemId } from '../commons/CommonTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { HexColor } from '../utils/StyleUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import CommonTextHover from 'src/features/game/commons/CommonTextHover'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { HexColor } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import AwardsConstants, { awardExplanation, awardKeyStyle, diff --git a/src/features/game/awards/GameAwardsManager.ts b/src/features/game/awards/GameAwardsManager.ts index 9b374d29cf..2a002802c9 100644 --- a/src/features/game/awards/GameAwardsManager.ts +++ b/src/features/game/awards/GameAwardsManager.ts @@ -1,12 +1,13 @@ -import ImageAssets from '../assets/ImageAssets'; -import { Constants } from '../commons/CommonConstants'; -import { IBaseScene } from '../commons/CommonTypes'; -import { DashboardPageManager } from '../dashboard/GameDashboardTypes'; -import { createButton } from '../utils/ButtonUtils'; -import { limitNumber } from '../utils/GameUtils'; -import { resizeUnderflow } from '../utils/SpriteUtils'; -import { calcListFormatPos } from '../utils/StyleUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { IBaseScene } from 'src/features/game/commons/CommonTypes'; +import { DashboardPageManager } from 'src/features/game/dashboard/GameDashboardTypes'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { limitNumber } from 'src/features/game/utils/GameUtils'; +import { resizeUnderflow } from 'src/features/game/utils/SpriteUtils'; +import { calcListFormatPos } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import AwardsConstants, { awardDescStyle, awardKeyStyle, diff --git a/src/features/game/awards/GameAwardsTypes.ts b/src/features/game/awards/GameAwardsTypes.ts index 142abfd39f..00f48a2c6c 100644 --- a/src/features/game/awards/GameAwardsTypes.ts +++ b/src/features/game/awards/GameAwardsTypes.ts @@ -1,4 +1,4 @@ -import { AssetKey, AssetPath, ItemId } from '../commons/CommonTypes'; +import { AssetKey, AssetPath, ItemId } from 'src/features/game/commons/CommonTypes'; export type AwardProperty = { id: ItemId; diff --git a/src/features/game/background/GameBackgroundManager.ts b/src/features/game/background/GameBackgroundManager.ts index fd835b42a7..ffacfa0479 100644 --- a/src/features/game/background/GameBackgroundManager.ts +++ b/src/features/game/background/GameBackgroundManager.ts @@ -1,10 +1,10 @@ -import { ImageAsset } from '../assets/AssetsTypes'; -import { screenSize } from '../commons/CommonConstants'; -import { AssetKey } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import { LocationId } from '../location/GameMapTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { resizeOverflow } from '../utils/SpriteUtils'; +import { ImageAsset } from 'src/features/game/assets/AssetsTypes'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { AssetKey } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { LocationId } from 'src/features/game/location/GameMapTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { resizeOverflow } from 'src/features/game/utils/SpriteUtils'; /** * Manager for game's background. diff --git a/src/features/game/boundingBoxes/GameBoundingBoxManager.ts b/src/features/game/boundingBoxes/GameBoundingBoxManager.ts index 54f842c35d..f55522776f 100644 --- a/src/features/game/boundingBoxes/GameBoundingBoxManager.ts +++ b/src/features/game/boundingBoxes/GameBoundingBoxManager.ts @@ -1,10 +1,10 @@ +import { ItemId } from 'src/features/game/commons/CommonTypes'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import { ActivatableSprite } from 'src/features/game/objects/GameObjectTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { StateObserver } from 'src/features/game/state/GameStateTypes'; -import { ItemId } from '../commons/CommonTypes'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import { ActivatableSprite } from '../objects/GameObjectTypes'; -import { StateObserver } from '../state/GameStateTypes'; import { BBoxProperty } from './GameBoundingBoxTypes'; /** diff --git a/src/features/game/boundingBoxes/GameBoundingBoxTypes.ts b/src/features/game/boundingBoxes/GameBoundingBoxTypes.ts index fab8e5d556..39341d033b 100644 --- a/src/features/game/boundingBoxes/GameBoundingBoxTypes.ts +++ b/src/features/game/boundingBoxes/GameBoundingBoxTypes.ts @@ -1,5 +1,5 @@ -import { IGameActionable } from '../action/GameActionTypes'; -import { TrackInteraction } from '../commons/CommonTypes'; +import { IGameActionable } from 'src/features/game/action/GameActionTypes'; +import { TrackInteraction } from 'src/features/game/commons/CommonTypes'; /** * Information on a bounding box, a clickable rectangle area diff --git a/src/features/game/chapter/GameChapterHelpers.ts b/src/features/game/chapter/GameChapterHelpers.ts index aad52ae7c4..8e794e1d83 100644 --- a/src/features/game/chapter/GameChapterHelpers.ts +++ b/src/features/game/chapter/GameChapterHelpers.ts @@ -1,9 +1,9 @@ import _ from 'lodash'; import { request } from 'src/commons/utils/RequestHelper'; +import { toTxtPath } from 'src/features/game/assets/TextAssets'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { store } from 'src/pages/createStore'; -import { store } from '../../../pages/createStore'; -import { toTxtPath } from '../assets/TextAssets'; -import SourceAcademyGame from '../SourceAcademyGame'; import { GameChapter } from './GameChapterTypes'; /** diff --git a/src/features/game/chapter/GameChapterTypes.ts b/src/features/game/chapter/GameChapterTypes.ts index 80e90e1deb..c2eb3a3e0c 100644 --- a/src/features/game/chapter/GameChapterTypes.ts +++ b/src/features/game/chapter/GameChapterTypes.ts @@ -1,6 +1,6 @@ -import GameMap from '../location/GameMap'; -import GameObjective from '../objective/GameObjective'; -import GameTask from '../task/GameTask'; +import GameMap from 'src/features/game/location/GameMap'; +import GameObjective from 'src/features/game/objective/GameObjective'; +import GameTask from 'src/features/game/task/GameTask'; /** * Encapsulates information about a checkpoint diff --git a/src/features/game/character/GameCharacterConstants.ts b/src/features/game/character/GameCharacterConstants.ts index a629e72beb..c4362800c3 100644 --- a/src/features/game/character/GameCharacterConstants.ts +++ b/src/features/game/character/GameCharacterConstants.ts @@ -1,4 +1,4 @@ -import { screenCenter, screenSize } from '../commons/CommonConstants'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; const charXOffset = 350; diff --git a/src/features/game/character/GameCharacterManager.ts b/src/features/game/character/GameCharacterManager.ts index 63b13099c0..25931c4258 100644 --- a/src/features/game/character/GameCharacterManager.ts +++ b/src/features/game/character/GameCharacterManager.ts @@ -1,11 +1,11 @@ +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { GamePosition, ItemId } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { StateObserver } from 'src/features/game/state/GameStateTypes'; +import { resize } from 'src/features/game/utils/SpriteUtils'; -import { screenSize } from '../commons/CommonConstants'; -import { GamePosition, ItemId } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import { StateObserver } from '../state/GameStateTypes'; -import { resize } from '../utils/SpriteUtils'; import CharConstants from './GameCharacterConstants'; /** diff --git a/src/features/game/character/GameCharacterTypes.ts b/src/features/game/character/GameCharacterTypes.ts index b71414b1bd..82cd2fb27a 100644 --- a/src/features/game/character/GameCharacterTypes.ts +++ b/src/features/game/character/GameCharacterTypes.ts @@ -1,4 +1,4 @@ -import { AssetKey, GamePosition, ItemId } from '../commons/CommonTypes'; +import { AssetKey, GamePosition, ItemId } from 'src/features/game/commons/CommonTypes'; export type SpeakerDetail = { speakerId: ItemId; diff --git a/src/features/game/commons/CommonBackButton.ts b/src/features/game/commons/CommonBackButton.ts index eff595ecda..f8ef7c6bdb 100644 --- a/src/features/game/commons/CommonBackButton.ts +++ b/src/features/game/commons/CommonBackButton.ts @@ -1,6 +1,7 @@ -import FontAssets from '../assets/FontAssets'; -import ImageAssets from '../assets/ImageAssets'; -import { createButton } from '../utils/ButtonUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; + import { screenCenter } from './CommonConstants'; import { BitmapFontStyle } from './CommonTypes'; diff --git a/src/features/game/commons/CommonConstants.ts b/src/features/game/commons/CommonConstants.ts index 64ab1b6ee5..3822155828 100644 --- a/src/features/game/commons/CommonConstants.ts +++ b/src/features/game/commons/CommonConstants.ts @@ -1,6 +1,5 @@ import { Links } from 'src/commons/utils/Constants'; - -import FontAssets from '../assets/FontAssets'; +import FontAssets from 'src/features/game/assets/FontAssets'; export const Constants = { assetsFolder: Links.sourceAcademyAssets, diff --git a/src/features/game/commons/CommonRadioButton.ts b/src/features/game/commons/CommonRadioButton.ts index 5f52a3283e..dd1adcaf1c 100644 --- a/src/features/game/commons/CommonRadioButton.ts +++ b/src/features/game/commons/CommonRadioButton.ts @@ -1,7 +1,8 @@ -import SoundAssets from '../assets/SoundAssets'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { calcTableFormatPos, HexColor } from '../utils/StyleUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { calcTableFormatPos, HexColor } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import { Constants, screenSize } from './CommonConstants'; import { AssetKey, BitmapFontStyle, TextConfig } from './CommonTypes'; diff --git a/src/features/game/commons/CommonTextHover.ts b/src/features/game/commons/CommonTextHover.ts index 5574859b41..ececf3c230 100644 --- a/src/features/game/commons/CommonTextHover.ts +++ b/src/features/game/commons/CommonTextHover.ts @@ -1,4 +1,4 @@ -import { Color, HexColor } from '../utils/StyleUtils'; +import { Color, HexColor } from 'src/features/game/utils/StyleUtils'; const textPad = 10; const defaultTextHoverWidth = 300; diff --git a/src/features/game/commons/CommonTypes.ts b/src/features/game/commons/CommonTypes.ts index 48cbaa4dbc..520fafe984 100644 --- a/src/features/game/commons/CommonTypes.ts +++ b/src/features/game/commons/CommonTypes.ts @@ -1,6 +1,6 @@ -import GameInputManager from '../input/GameInputManager'; -import GameLayerManager from '../layer/GameLayerManager'; -import GamePhaseManager from '../phase/GamePhaseManager'; +import GameInputManager from 'src/features/game/input/GameInputManager'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import GamePhaseManager from 'src/features/game/phase/GamePhaseManager'; /** * Encapsulate style of bitmap text. diff --git a/src/features/game/dashboard/GameDashboardConstants.ts b/src/features/game/dashboard/GameDashboardConstants.ts index 721b821430..8c5eb15ae8 100644 --- a/src/features/game/dashboard/GameDashboardConstants.ts +++ b/src/features/game/dashboard/GameDashboardConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../assets/FontAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const pageBannerTextStyle: BitmapFontStyle = { key: FontAssets.alienLeagueFont.key, diff --git a/src/features/game/dashboard/GameDashboardManager.ts b/src/features/game/dashboard/GameDashboardManager.ts index f8960717c7..4255220fe9 100644 --- a/src/features/game/dashboard/GameDashboardManager.ts +++ b/src/features/game/dashboard/GameDashboardManager.ts @@ -1,15 +1,16 @@ -import ImageAssets from '../assets/ImageAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { screenCenter, screenSize } from '../commons/CommonConstants'; -import { IBaseScene, IGameUI } from '../commons/CommonTypes'; -import { fadeAndDestroy } from '../effects/FadeEffect'; -import { entryTweenProps, exitTweenProps } from '../effects/FlyEffect'; -import { Layer } from '../layer/GameLayerTypes'; -import { GamePhaseType } from '../phase/GamePhaseTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { createButton } from '../utils/ButtonUtils'; -import { sleep } from '../utils/GameUtils'; -import { calcListFormatPos } from '../utils/StyleUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { IBaseScene, IGameUI } from 'src/features/game/commons/CommonTypes'; +import { fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import { entryTweenProps, exitTweenProps } from 'src/features/game/effects/FlyEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { calcListFormatPos } from 'src/features/game/utils/StyleUtils'; + import DashboardConstants, { pageBannerTextStyle } from './GameDashboardConstants'; import { DashboardPage, DashboardPageManager } from './GameDashboardTypes'; diff --git a/src/features/game/dialogue/GameDialogueConstants.ts b/src/features/game/dialogue/GameDialogueConstants.ts index 4352970beb..fd300eef41 100644 --- a/src/features/game/dialogue/GameDialogueConstants.ts +++ b/src/features/game/dialogue/GameDialogueConstants.ts @@ -1,7 +1,7 @@ -import FontAssets from '../assets/FontAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; -import { Color } from '../utils/StyleUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; +import { Color } from 'src/features/game/utils/StyleUtils'; const dialogueRectMargin = 10; diff --git a/src/features/game/dialogue/GameDialogueGenerator.ts b/src/features/game/dialogue/GameDialogueGenerator.ts index 5faa7cce79..97b3ec5d33 100644 --- a/src/features/game/dialogue/GameDialogueGenerator.ts +++ b/src/features/game/dialogue/GameDialogueGenerator.ts @@ -1,4 +1,5 @@ -import GameActionConditionChecker from '../action/GameActionConditionChecker'; +import GameActionConditionChecker from 'src/features/game/action/GameActionConditionChecker'; + import { DialogueLine, DialogueObject, PartName } from './GameDialogueTypes'; /** diff --git a/src/features/game/dialogue/GameDialogueHelper.ts b/src/features/game/dialogue/GameDialogueHelper.ts index c79fb12403..69bc9b2ffe 100644 --- a/src/features/game/dialogue/GameDialogueHelper.ts +++ b/src/features/game/dialogue/GameDialogueHelper.ts @@ -1,6 +1,7 @@ -import ImageAssets from '../assets/ImageAssets'; -import { screenCenter } from '../commons/CommonConstants'; -import Typewriter from '../effects/Typewriter'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { screenCenter } from 'src/features/game/commons/CommonConstants'; +import Typewriter from 'src/features/game/effects/Typewriter'; + import dialogueConstants from './GameDialogueConstants'; /** diff --git a/src/features/game/dialogue/GameDialogueManager.ts b/src/features/game/dialogue/GameDialogueManager.ts index 87fb65878e..c54e9a5aea 100644 --- a/src/features/game/dialogue/GameDialogueManager.ts +++ b/src/features/game/dialogue/GameDialogueManager.ts @@ -1,9 +1,10 @@ -import SoundAssets from '../assets/SoundAssets'; -import { ItemId } from '../commons/CommonTypes'; -import { promptWithChoices } from '../effects/Prompt'; -import { Layer } from '../layer/GameLayerTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import { promptWithChoices } from 'src/features/game/effects/Prompt'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; + import { textTypeWriterStyle } from './GameDialogueConstants'; import DialogueGenerator from './GameDialogueGenerator'; import DialogueRenderer from './GameDialogueRenderer'; diff --git a/src/features/game/dialogue/GameDialogueRenderer.ts b/src/features/game/dialogue/GameDialogueRenderer.ts index 092296c5cf..f2f01e4d64 100644 --- a/src/features/game/dialogue/GameDialogueRenderer.ts +++ b/src/features/game/dialogue/GameDialogueRenderer.ts @@ -1,7 +1,8 @@ -import ImageAssets from '../assets/ImageAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { blink, fadeAndDestroy } from '../effects/FadeEffect'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { blink, fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; + import dialogueConstants from './GameDialogueConstants'; import { createDialogueBox, createTypewriter } from './GameDialogueHelper'; diff --git a/src/features/game/dialogue/GameDialogueSpeakerRenderer.ts b/src/features/game/dialogue/GameDialogueSpeakerRenderer.ts index 3a58adbb05..e171b77f66 100644 --- a/src/features/game/dialogue/GameDialogueSpeakerRenderer.ts +++ b/src/features/game/dialogue/GameDialogueSpeakerRenderer.ts @@ -1,12 +1,13 @@ -import ImageAssets from '../assets/ImageAssets'; -import { SpeakerDetail } from '../character/GameCharacterTypes'; -import { screenCenter, screenSize } from '../commons/CommonConstants'; -import { GamePosition, ItemId } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; -import StringUtils from '../utils/StringUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { SpeakerDetail } from 'src/features/game/character/GameCharacterTypes'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { GamePosition, ItemId } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import StringUtils from 'src/features/game/utils/StringUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import DialogueConstants, { speakerTextStyle } from './GameDialogueConstants'; /** diff --git a/src/features/game/dialogue/GameDialogueStorageManager.ts b/src/features/game/dialogue/GameDialogueStorageManager.ts index ef28237f5a..7de24885eb 100644 --- a/src/features/game/dialogue/GameDialogueStorageManager.ts +++ b/src/features/game/dialogue/GameDialogueStorageManager.ts @@ -1,6 +1,7 @@ -import { SpeakerDetail } from '../character/GameCharacterTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; +import { SpeakerDetail } from 'src/features/game/character/GameCharacterTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; + import { DialogueStorageLine } from './GameDialogueTypes'; /** diff --git a/src/features/game/dialogue/GameDialogueTypes.ts b/src/features/game/dialogue/GameDialogueTypes.ts index 9e0a6ac8d4..8df52b6b73 100644 --- a/src/features/game/dialogue/GameDialogueTypes.ts +++ b/src/features/game/dialogue/GameDialogueTypes.ts @@ -1,5 +1,5 @@ -import { ActionCondition, IGameActionable } from '../action/GameActionTypes'; -import { SpeakerDetail } from '../character/GameCharacterTypes'; +import { ActionCondition, IGameActionable } from 'src/features/game/action/GameActionTypes'; +import { SpeakerDetail } from 'src/features/game/character/GameCharacterTypes'; /** * @typedef {string} PartName - the label for one part/section of the dialogue diff --git a/src/features/game/effects/FadeEffect.ts b/src/features/game/effects/FadeEffect.ts index cb6cca823b..69b699f46f 100644 --- a/src/features/game/effects/FadeEffect.ts +++ b/src/features/game/effects/FadeEffect.ts @@ -1,8 +1,8 @@ -import { Constants, screenCenter, screenSize } from '../commons/CommonConstants'; -import { IBaseScene } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import { sleep } from '../utils/GameUtils'; -import { HexColor } from '../utils/StyleUtils'; +import { Constants, screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { IBaseScene } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { HexColor } from 'src/features/game/utils/StyleUtils'; /** * Generates a tween configuration for making objects fade out of scene. diff --git a/src/features/game/effects/FlyEffect.ts b/src/features/game/effects/FlyEffect.ts index ac106e2541..904b1285e7 100644 --- a/src/features/game/effects/FlyEffect.ts +++ b/src/features/game/effects/FlyEffect.ts @@ -1,4 +1,4 @@ -import { screenSize } from '../commons/CommonConstants'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; /** * A tween config that makes the object fly in diff --git a/src/features/game/effects/Glitch.ts b/src/features/game/effects/Glitch.ts index 2c4584e7d4..1a050c7a60 100644 --- a/src/features/game/effects/Glitch.ts +++ b/src/features/game/effects/Glitch.ts @@ -1,6 +1,6 @@ -import FontAssets from '../assets/FontAssets'; -import { BitmapFontStyle, ILayeredScene, TextConfig } from '../commons/CommonTypes'; -import { createBitmapText } from '../utils/TextUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { BitmapFontStyle, ILayeredScene, TextConfig } from 'src/features/game/commons/CommonTypes'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; const defaultGlitchStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/effects/GlowingObject.ts b/src/features/game/effects/GlowingObject.ts index 19569d14f3..8f7d3c1bc5 100644 --- a/src/features/game/effects/GlowingObject.ts +++ b/src/features/game/effects/GlowingObject.ts @@ -1,6 +1,7 @@ -import { AssetType } from '../assets/AssetsTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { resize } from '../utils/SpriteUtils'; +import { AssetType } from 'src/features/game/assets/AssetsTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { resize } from 'src/features/game/utils/SpriteUtils'; + import { blink } from './FadeEffect'; /** diff --git a/src/features/game/effects/LoadingScreen.ts b/src/features/game/effects/LoadingScreen.ts index 6873ac597e..f636e7d16d 100644 --- a/src/features/game/effects/LoadingScreen.ts +++ b/src/features/game/effects/LoadingScreen.ts @@ -1,4 +1,5 @@ -import { screenCenter } from '../commons/CommonConstants'; +import { screenCenter } from 'src/features/game/commons/CommonConstants'; + import { blackScreen } from './FadeEffect'; const barWidth = 320; diff --git a/src/features/game/effects/MiniMessage.ts b/src/features/game/effects/MiniMessage.ts index 4f3bfba033..607cd95c18 100644 --- a/src/features/game/effects/MiniMessage.ts +++ b/src/features/game/effects/MiniMessage.ts @@ -1,12 +1,13 @@ -import FontAssets from '../assets/FontAssets'; -import ImageAssets from '../assets/ImageAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { Constants, screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle, IBaseScene } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { sleep } from '../utils/GameUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle, IBaseScene } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import { fadeAndDestroy } from './FadeEffect'; import { rightSideEntryTweenProps, rightSideExitTweenProps } from './FlyEffect'; diff --git a/src/features/game/effects/Notification.ts b/src/features/game/effects/Notification.ts index 7a9557cab6..0f40b9dc28 100644 --- a/src/features/game/effects/Notification.ts +++ b/src/features/game/effects/Notification.ts @@ -1,14 +1,14 @@ +import FontAssets from 'src/features/game/assets/FontAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants, screenCenter } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle, IBaseScene } from 'src/features/game/commons/CommonTypes'; +import dialogueConstants from 'src/features/game/dialogue/GameDialogueConstants'; +import DialogueRenderer from 'src/features/game/dialogue/GameDialogueRenderer'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; -import FontAssets from '../assets/FontAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { Constants, screenCenter } from '../commons/CommonConstants'; -import { BitmapFontStyle, IBaseScene } from '../commons/CommonTypes'; -import dialogueConstants from '../dialogue/GameDialogueConstants'; -import DialogueRenderer from '../dialogue/GameDialogueRenderer'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { sleep } from '../utils/GameUtils'; -import { createBitmapText } from '../utils/TextUtils'; import { fadeAndDestroy, fadeIn } from './FadeEffect'; const notifStyle: BitmapFontStyle = { diff --git a/src/features/game/effects/Prompt.ts b/src/features/game/effects/Prompt.ts index fdd8682f3a..a6d9d076bc 100644 --- a/src/features/game/effects/Prompt.ts +++ b/src/features/game/effects/Prompt.ts @@ -1,14 +1,15 @@ -import FontAssets from '../assets/FontAssets'; -import ImageAssets from '../assets/ImageAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { Constants, screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { createButton } from '../utils/ButtonUtils'; -import { sleep } from '../utils/GameUtils'; -import { calcListFormatPos, Color, HexColor } from '../utils/StyleUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { calcListFormatPos, Color, HexColor } from 'src/features/game/utils/StyleUtils'; + import { fadeAndDestroy } from './FadeEffect'; import { rightSideEntryTweenProps, rightSideExitTweenProps } from './FlyEffect'; diff --git a/src/features/game/effects/WorkerMessage.ts b/src/features/game/effects/WorkerMessage.ts index ed00941ef3..6cdd9282d2 100644 --- a/src/features/game/effects/WorkerMessage.ts +++ b/src/features/game/effects/WorkerMessage.ts @@ -1,10 +1,11 @@ -import SoundAssets from '../assets/SoundAssets'; -import { Constants, screenCenter } from '../commons/CommonConstants'; -import { ILayeredScene } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { sleep } from '../utils/GameUtils'; -import { calcListFormatPos } from '../utils/StyleUtils'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants, screenCenter } from 'src/features/game/commons/CommonConstants'; +import { ILayeredScene } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { calcListFormatPos } from 'src/features/game/utils/StyleUtils'; + import { blackScreen, fadeAndDestroy, fadeIn } from './FadeEffect'; import { createGlitchBitmapText } from './Glitch'; diff --git a/src/features/game/escape/GameEscapeConstants.ts b/src/features/game/escape/GameEscapeConstants.ts index b418cfddb6..4b729db53e 100644 --- a/src/features/game/escape/GameEscapeConstants.ts +++ b/src/features/game/escape/GameEscapeConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../assets/FontAssets'; -import { screenCenter, screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const escapeOptButtonStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/escape/GameEscapeManager.ts b/src/features/game/escape/GameEscapeManager.ts index 2ce5a18014..32f8078def 100644 --- a/src/features/game/escape/GameEscapeManager.ts +++ b/src/features/game/escape/GameEscapeManager.ts @@ -1,15 +1,16 @@ -import ImageAssets from '../assets/ImageAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { screenCenter, screenSize } from '../commons/CommonConstants'; -import CommonRadioButton from '../commons/CommonRadioButton'; -import { IBaseScene, IGameUI } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import { GamePhaseType } from '../phase/GamePhaseTypes'; -import SettingsConstants from '../scenes/settings/SettingsConstants'; -import SourceAcademyGame, { GameType } from '../SourceAcademyGame'; -import { createButton } from '../utils/ButtonUtils'; -import { calcTableFormatPos, Direction } from '../utils/StyleUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import CommonRadioButton from 'src/features/game/commons/CommonRadioButton'; +import { IBaseScene, IGameUI } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import SettingsConstants from 'src/features/game/scenes/settings/SettingsConstants'; +import SourceAcademyGame, { GameType } from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { calcTableFormatPos, Direction } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import EscapeConstants, { escapeOptButtonStyle, optTextStyle, diff --git a/src/features/game/layer/GameLayerManager.ts b/src/features/game/layer/GameLayerManager.ts index c667c02674..3ea6ba1fce 100644 --- a/src/features/game/layer/GameLayerManager.ts +++ b/src/features/game/layer/GameLayerManager.ts @@ -1,8 +1,8 @@ +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { fadeIn, fadeOut } from 'src/features/game/effects/FadeEffect'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { sleep } from 'src/features/game/utils/GameUtils'; -import { Constants } from '../commons/CommonConstants'; -import { fadeIn, fadeOut } from '../effects/FadeEffect'; -import { sleep } from '../utils/GameUtils'; import { defaultLayerSequence, Layer } from './GameLayerTypes'; /** diff --git a/src/features/game/location/GameMap.ts b/src/features/game/location/GameMap.ts index d009abce86..4479f0c4f0 100644 --- a/src/features/game/location/GameMap.ts +++ b/src/features/game/location/GameMap.ts @@ -1,12 +1,13 @@ -import { GameAction } from '../action/GameActionTypes'; -import { ImageAsset, SoundAsset } from '../assets/AssetsTypes'; -import { BBoxProperty } from '../boundingBoxes/GameBoundingBoxTypes'; -import { Character } from '../character/GameCharacterTypes'; -import { AssetKey, ItemId } from '../commons/CommonTypes'; -import { Dialogue } from '../dialogue/GameDialogueTypes'; -import { GameMode } from '../mode/GameModeTypes'; -import { ObjectProperty } from '../objects/GameObjectTypes'; -import { mandatory } from '../utils/GameUtils'; +import { GameAction } from 'src/features/game/action/GameActionTypes'; +import { ImageAsset, SoundAsset } from 'src/features/game/assets/AssetsTypes'; +import { BBoxProperty } from 'src/features/game/boundingBoxes/GameBoundingBoxTypes'; +import { Character } from 'src/features/game/character/GameCharacterTypes'; +import { AssetKey, ItemId } from 'src/features/game/commons/CommonTypes'; +import { Dialogue } from 'src/features/game/dialogue/GameDialogueTypes'; +import { GameMode } from 'src/features/game/mode/GameModeTypes'; +import { ObjectProperty } from 'src/features/game/objects/GameObjectTypes'; +import { mandatory } from 'src/features/game/utils/GameUtils'; + import { AnyId, GameItemType, GameLocation, LocationId } from './GameMapTypes'; /** diff --git a/src/features/game/location/GameMapTypes.ts b/src/features/game/location/GameMapTypes.ts index 21a36fd1b6..a639541206 100644 --- a/src/features/game/location/GameMapTypes.ts +++ b/src/features/game/location/GameMapTypes.ts @@ -1,6 +1,6 @@ -import { IGameActionable } from '../action/GameActionTypes'; -import { AssetKey, ItemId } from '../commons/CommonTypes'; -import { GameMode } from '../mode/GameModeTypes'; +import { IGameActionable } from 'src/features/game/action/GameActionTypes'; +import { AssetKey, ItemId } from 'src/features/game/commons/CommonTypes'; +import { GameMode } from 'src/features/game/mode/GameModeTypes'; /** * @typedef {string} LocationId - id that identifies a location diff --git a/src/features/game/log/GameLogConstants.ts b/src/features/game/log/GameLogConstants.ts index 01552ff8cf..087cc523ff 100644 --- a/src/features/game/log/GameLogConstants.ts +++ b/src/features/game/log/GameLogConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../assets/FontAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const logTextStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/log/GameLogManager.ts b/src/features/game/log/GameLogManager.ts index 9e66c36be2..ae7d4c35c8 100644 --- a/src/features/game/log/GameLogManager.ts +++ b/src/features/game/log/GameLogManager.ts @@ -1,9 +1,10 @@ -import { IBaseScene } from '../commons/CommonTypes'; -import DashboardConstants from '../dashboard/GameDashboardConstants'; -import { DashboardPageManager } from '../dashboard/GameDashboardTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { limitNumber } from '../utils/GameUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import { IBaseScene } from 'src/features/game/commons/CommonTypes'; +import DashboardConstants from 'src/features/game/dashboard/GameDashboardConstants'; +import { DashboardPageManager } from 'src/features/game/dashboard/GameDashboardTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { limitNumber } from 'src/features/game/utils/GameUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import LogConstants, { logTextStyle } from './GameLogConstants'; /** diff --git a/src/features/game/mode/GameModeTypes.ts b/src/features/game/mode/GameModeTypes.ts index 7a30955cf3..aaf2af463c 100644 --- a/src/features/game/mode/GameModeTypes.ts +++ b/src/features/game/mode/GameModeTypes.ts @@ -1,4 +1,4 @@ -import { GamePhaseType } from '../phase/GamePhaseTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; export enum GameMode { Move = 'Move', diff --git a/src/features/game/mode/explore/GameModeExplore.ts b/src/features/game/mode/explore/GameModeExplore.ts index 5ac6db41f2..5d096b8724 100644 --- a/src/features/game/mode/explore/GameModeExplore.ts +++ b/src/features/game/mode/explore/GameModeExplore.ts @@ -1,15 +1,15 @@ +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { Constants, screenSize } from 'src/features/game/commons/CommonConstants'; +import { IGameUI, ItemId } from 'src/features/game/commons/CommonTypes'; +import { fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import { entryTweenProps, exitTweenProps } from 'src/features/game/effects/FlyEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { ActivatableSprite } from 'src/features/game/objects/GameObjectTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { sleep } from 'src/features/game/utils/GameUtils'; -import SoundAssets from '../../assets/SoundAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { Constants, screenSize } from '../../commons/CommonConstants'; -import { IGameUI, ItemId } from '../../commons/CommonTypes'; -import { fadeAndDestroy } from '../../effects/FadeEffect'; -import { entryTweenProps, exitTweenProps } from '../../effects/FlyEffect'; -import { Layer } from '../../layer/GameLayerTypes'; -import { ActivatableSprite } from '../../objects/GameObjectTypes'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import { sleep } from '../../utils/GameUtils'; import ExploreModeConstants from './GameModeExploreConstants'; /** diff --git a/src/features/game/mode/explore/GameModeExploreConstants.ts b/src/features/game/mode/explore/GameModeExploreConstants.ts index fcbce00cd4..610b550b78 100644 --- a/src/features/game/mode/explore/GameModeExploreConstants.ts +++ b/src/features/game/mode/explore/GameModeExploreConstants.ts @@ -1,4 +1,4 @@ -import { toS3Path } from '../../utils/GameUtils'; +import { toS3Path } from 'src/features/game/utils/GameUtils'; const ExploreModeConstants = { normal: `url(${toS3Path('/ui/magnifying.png', false)}), pointer`, diff --git a/src/features/game/mode/menu/GameModeMenu.ts b/src/features/game/mode/menu/GameModeMenu.ts index fb262207d9..a47ab08f76 100644 --- a/src/features/game/mode/menu/GameModeMenu.ts +++ b/src/features/game/mode/menu/GameModeMenu.ts @@ -1,16 +1,16 @@ +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { IGameUI } from 'src/features/game/commons/CommonTypes'; +import { fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import { GameMode, gameModeToPhase } from 'src/features/game/mode/GameModeTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { calcTableFormatPos } from 'src/features/game/utils/StyleUtils'; -import ImageAssets from '../../assets/ImageAssets'; -import SoundAssets from '../../assets/SoundAssets'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { IGameUI } from '../../commons/CommonTypes'; -import { fadeAndDestroy } from '../../effects/FadeEffect'; -import { Layer } from '../../layer/GameLayerTypes'; -import { GameItemType } from '../../location/GameMapTypes'; -import { createButton } from '../../utils/ButtonUtils'; -import { sleep } from '../../utils/GameUtils'; -import { calcTableFormatPos } from '../../utils/StyleUtils'; -import { GameMode, gameModeToPhase } from '../GameModeTypes'; import MenuModeConstants, { modeButtonStyle } from './GameModeMenuConstants'; /** diff --git a/src/features/game/mode/menu/GameModeMenuConstants.ts b/src/features/game/mode/menu/GameModeMenuConstants.ts index 4e09b82f8f..b6176c7dfd 100644 --- a/src/features/game/mode/menu/GameModeMenuConstants.ts +++ b/src/features/game/mode/menu/GameModeMenuConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const modeButtonStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/mode/move/GameModeMove.ts b/src/features/game/mode/move/GameModeMove.ts index 686a0693e4..096524a47e 100644 --- a/src/features/game/mode/move/GameModeMove.ts +++ b/src/features/game/mode/move/GameModeMove.ts @@ -1,17 +1,18 @@ -import ImageAssets from '../../assets/ImageAssets'; -import SoundAssets from '../../assets/SoundAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { IGameUI } from '../../commons/CommonTypes'; -import { fadeAndDestroy } from '../../effects/FadeEffect'; -import { entryTweenProps, exitTweenProps } from '../../effects/FlyEffect'; -import { Layer } from '../../layer/GameLayerTypes'; -import { GameItemType, LocationId } from '../../location/GameMapTypes'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import GameGlobalAPI from '../../scenes/gameManager/GameGlobalAPI'; -import { createButton } from '../../utils/ButtonUtils'; -import { sleep } from '../../utils/GameUtils'; -import { calcTableFormatPos } from '../../utils/StyleUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { IGameUI } from 'src/features/game/commons/CommonTypes'; +import { fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import { entryTweenProps, exitTweenProps } from 'src/features/game/effects/FlyEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { calcTableFormatPos } from 'src/features/game/utils/StyleUtils'; + import MoveModeConstants, { moveButtonStyle } from './GameModeMoveConstants'; /** diff --git a/src/features/game/mode/move/GameModeMoveConstants.ts b/src/features/game/mode/move/GameModeMoveConstants.ts index ece434c6b8..2af55a751e 100644 --- a/src/features/game/mode/move/GameModeMoveConstants.ts +++ b/src/features/game/mode/move/GameModeMoveConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const moveButtonStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/mode/sequence/GameModeSequence.ts b/src/features/game/mode/sequence/GameModeSequence.ts index c76a950567..57f2773111 100644 --- a/src/features/game/mode/sequence/GameModeSequence.ts +++ b/src/features/game/mode/sequence/GameModeSequence.ts @@ -1,4 +1,4 @@ -import { IGameUI } from '../../commons/CommonTypes'; +import { IGameUI } from 'src/features/game/commons/CommonTypes'; /** * This is the phase that is active when none of diff --git a/src/features/game/mode/talk/GameModeTalk.ts b/src/features/game/mode/talk/GameModeTalk.ts index 66f98fccdd..03e99c630e 100644 --- a/src/features/game/mode/talk/GameModeTalk.ts +++ b/src/features/game/mode/talk/GameModeTalk.ts @@ -1,18 +1,18 @@ +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { IGameUI, ItemId } from 'src/features/game/commons/CommonTypes'; +import { fadeAndDestroy } from 'src/features/game/effects/FadeEffect'; +import { entryTweenProps, exitTweenProps } from 'src/features/game/effects/FlyEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { mandatory, sleep } from 'src/features/game/utils/GameUtils'; +import { calcTableFormatPos, Direction } from 'src/features/game/utils/StyleUtils'; -import ImageAssets from '../../assets/ImageAssets'; -import SoundAssets from '../../assets/SoundAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { screenSize } from '../../commons/CommonConstants'; -import { IGameUI, ItemId } from '../../commons/CommonTypes'; -import { fadeAndDestroy } from '../../effects/FadeEffect'; -import { entryTweenProps, exitTweenProps } from '../../effects/FlyEffect'; -import { Layer } from '../../layer/GameLayerTypes'; -import { GameItemType } from '../../location/GameMapTypes'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import { createButton } from '../../utils/ButtonUtils'; -import { mandatory, sleep } from '../../utils/GameUtils'; -import { calcTableFormatPos, Direction } from '../../utils/StyleUtils'; import TalkModeConstants, { talkButtonStyle } from './GameModeTalkConstants'; /** diff --git a/src/features/game/mode/talk/GameModeTalkConstants.ts b/src/features/game/mode/talk/GameModeTalkConstants.ts index 4ddc0b4243..f219e7278f 100644 --- a/src/features/game/mode/talk/GameModeTalkConstants.ts +++ b/src/features/game/mode/talk/GameModeTalkConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const talkButtonStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/objects/GameObjectManager.ts b/src/features/game/objects/GameObjectManager.ts index 7ad30e642b..535127648d 100644 --- a/src/features/game/objects/GameObjectManager.ts +++ b/src/features/game/objects/GameObjectManager.ts @@ -1,10 +1,10 @@ +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import GlowingImage from 'src/features/game/effects/GlowingObject'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { StateObserver } from 'src/features/game/state/GameStateTypes'; -import { ItemId } from '../commons/CommonTypes'; -import GlowingImage from '../effects/GlowingObject'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import { StateObserver } from '../state/GameStateTypes'; import { ActivatableSprite, ObjectProperty } from './GameObjectTypes'; /** diff --git a/src/features/game/objects/GameObjectTypes.ts b/src/features/game/objects/GameObjectTypes.ts index ff50041034..a92c54242f 100644 --- a/src/features/game/objects/GameObjectTypes.ts +++ b/src/features/game/objects/GameObjectTypes.ts @@ -1,6 +1,6 @@ -import { IGameActionable } from '../action/GameActionTypes'; -import { AssetKey, ItemId, TrackInteraction } from '../commons/CommonTypes'; -import GlowingImage from '../effects/GlowingObject'; +import { IGameActionable } from 'src/features/game/action/GameActionTypes'; +import { AssetKey, ItemId, TrackInteraction } from 'src/features/game/commons/CommonTypes'; +import GlowingImage from 'src/features/game/effects/GlowingObject'; /** * @typedef {ObjectProperty} - encapsulates data about an object in a location diff --git a/src/features/game/parser/ActionParser.ts b/src/features/game/parser/ActionParser.ts index 9cc216e21b..aea8d4102a 100644 --- a/src/features/game/parser/ActionParser.ts +++ b/src/features/game/parser/ActionParser.ts @@ -1,7 +1,8 @@ -import { GameAction, GameActionType } from '../action/GameActionTypes'; -import { ItemId } from '../commons/CommonTypes'; -import { GameItemType } from '../location/GameMapTypes'; -import StringUtils from '../utils/StringUtils'; +import { GameAction, GameActionType } from 'src/features/game/action/GameActionTypes'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ConditionParser from './ConditionParser'; import Parser from './Parser'; import ParserConverter from './ParserConverter'; diff --git a/src/features/game/parser/AwardParser.ts b/src/features/game/parser/AwardParser.ts index 23e3c853bc..ebed5efeed 100644 --- a/src/features/game/parser/AwardParser.ts +++ b/src/features/game/parser/AwardParser.ts @@ -1,7 +1,7 @@ -import { AwardProperty } from '../awards/GameAwardsTypes'; -import { ItemId } from '../commons/CommonTypes'; -import { toS3Path } from '../utils/GameUtils'; -import StringUtils from '../utils/StringUtils'; +import { AwardProperty } from 'src/features/game/awards/GameAwardsTypes'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import { toS3Path } from 'src/features/game/utils/GameUtils'; +import StringUtils from 'src/features/game/utils/StringUtils'; /** * This class parses the awardsMapping.txt, and creates a diff --git a/src/features/game/parser/BoundingBoxParser.ts b/src/features/game/parser/BoundingBoxParser.ts index 94f047c03e..317f973831 100644 --- a/src/features/game/parser/BoundingBoxParser.ts +++ b/src/features/game/parser/BoundingBoxParser.ts @@ -1,6 +1,7 @@ -import { BBoxProperty } from '../boundingBoxes/GameBoundingBoxTypes'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import StringUtils from '../utils/StringUtils'; +import { BBoxProperty } from 'src/features/game/boundingBoxes/GameBoundingBoxTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ActionParser from './ActionParser'; import Parser from './Parser'; diff --git a/src/features/game/parser/CharacterParser.ts b/src/features/game/parser/CharacterParser.ts index 5a6af55d20..785eda6e7a 100644 --- a/src/features/game/parser/CharacterParser.ts +++ b/src/features/game/parser/CharacterParser.ts @@ -1,8 +1,9 @@ -import { AssetType } from '../assets/AssetsTypes'; -import { Character } from '../character/GameCharacterTypes'; -import { AssetKey, ItemId } from '../commons/CommonTypes'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import StringUtils from '../utils/StringUtils'; +import { AssetType } from 'src/features/game/assets/AssetsTypes'; +import { Character } from 'src/features/game/character/GameCharacterTypes'; +import { AssetKey, ItemId } from 'src/features/game/commons/CommonTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import Parser from './Parser'; import ParserConverter from './ParserConverter'; diff --git a/src/features/game/parser/ConditionParser.ts b/src/features/game/parser/ConditionParser.ts index 3529025229..57e1c772ba 100644 --- a/src/features/game/parser/ConditionParser.ts +++ b/src/features/game/parser/ConditionParser.ts @@ -1,6 +1,7 @@ -import { ActionCondition } from '../action/GameActionTypes'; -import { GameStateStorage } from '../state/GameStateTypes'; -import StringUtils from '../utils/StringUtils'; +import { ActionCondition } from 'src/features/game/action/GameActionTypes'; +import { GameStateStorage } from 'src/features/game/state/GameStateTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import Parser from './Parser'; import ParserConverter from './ParserConverter'; import { GameEntityType } from './ParserValidator'; diff --git a/src/features/game/parser/DialogueParser.ts b/src/features/game/parser/DialogueParser.ts index 14d79ac4d4..88c0272910 100644 --- a/src/features/game/parser/DialogueParser.ts +++ b/src/features/game/parser/DialogueParser.ts @@ -1,7 +1,8 @@ -import { Dialogue, DialogueLine, PartName } from '../dialogue/GameDialogueTypes'; -import { GameItemType } from '../location/GameMapTypes'; -import { mapValues } from '../utils/GameUtils'; -import StringUtils from '../utils/StringUtils'; +import { Dialogue, DialogueLine, PartName } from 'src/features/game/dialogue/GameDialogueTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import { mapValues } from 'src/features/game/utils/GameUtils'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ActionParser from './ActionParser'; import ConditionParser from './ConditionParser'; import Parser from './Parser'; diff --git a/src/features/game/parser/LocationDetailsParser.ts b/src/features/game/parser/LocationDetailsParser.ts index 91a40012ff..44213599d5 100644 --- a/src/features/game/parser/LocationDetailsParser.ts +++ b/src/features/game/parser/LocationDetailsParser.ts @@ -1,7 +1,8 @@ -import { AnimType, AssetType } from '../assets/AssetsTypes'; -import { screenCenter, screenSize } from '../commons/CommonConstants'; -import { createEmptyLocation } from '../location/GameMapHelper'; -import StringUtils from '../utils/StringUtils'; +import { AnimType, AssetType } from 'src/features/game/assets/AssetsTypes'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { createEmptyLocation } from 'src/features/game/location/GameMapHelper'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import Parser from './Parser'; /** diff --git a/src/features/game/parser/LocationParser.ts b/src/features/game/parser/LocationParser.ts index b1b79f08ad..073a79d07f 100644 --- a/src/features/game/parser/LocationParser.ts +++ b/src/features/game/parser/LocationParser.ts @@ -1,7 +1,8 @@ -import { AssetType } from '../assets/AssetsTypes'; -import { GameItemType, GameLocation, LocationId } from '../location/GameMapTypes'; -import { GameSoundType } from '../sound/GameSoundTypes'; -import StringUtils from '../utils/StringUtils'; +import { AssetType } from 'src/features/game/assets/AssetsTypes'; +import { GameItemType, GameLocation, LocationId } from 'src/features/game/location/GameMapTypes'; +import { GameSoundType } from 'src/features/game/sound/GameSoundTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ActionParser from './ActionParser'; import BoundingBoxParser from './BoundingBoxParser'; import CharacterParser from './CharacterParser'; diff --git a/src/features/game/parser/MusicParser.ts b/src/features/game/parser/MusicParser.ts index aee6836e6c..a463f6ac66 100644 --- a/src/features/game/parser/MusicParser.ts +++ b/src/features/game/parser/MusicParser.ts @@ -1,6 +1,7 @@ -import { LocationId } from '../location/GameMapTypes'; -import { GameSoundType } from '../sound/GameSoundTypes'; -import StringUtils from '../utils/StringUtils'; +import { LocationId } from 'src/features/game/location/GameMapTypes'; +import { GameSoundType } from 'src/features/game/sound/GameSoundTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import Parser from './Parser'; /** diff --git a/src/features/game/parser/ObjectParser.ts b/src/features/game/parser/ObjectParser.ts index 1a23199201..1c74040acc 100644 --- a/src/features/game/parser/ObjectParser.ts +++ b/src/features/game/parser/ObjectParser.ts @@ -1,7 +1,8 @@ -import { AnimType, AssetType } from '../assets/AssetsTypes'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import { ObjectProperty } from '../objects/GameObjectTypes'; -import StringUtils from '../utils/StringUtils'; +import { AnimType, AssetType } from 'src/features/game/assets/AssetsTypes'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import { ObjectProperty } from 'src/features/game/objects/GameObjectTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ActionParser from './ActionParser'; import Parser from './Parser'; diff --git a/src/features/game/parser/Parser.ts b/src/features/game/parser/Parser.ts index 0ee1843a4b..6919a14e72 100644 --- a/src/features/game/parser/Parser.ts +++ b/src/features/game/parser/Parser.ts @@ -1,8 +1,9 @@ -import { GameCheckpoint } from '../chapter/GameChapterTypes'; -import GameMap from '../location/GameMap'; -import GameObjective from '../objective/GameObjective'; -import GameTask from '../task/GameTask'; -import StringUtils from '../utils/StringUtils'; +import { GameCheckpoint } from 'src/features/game/chapter/GameChapterTypes'; +import GameMap from 'src/features/game/location/GameMap'; +import GameObjective from 'src/features/game/objective/GameObjective'; +import GameTask from 'src/features/game/task/GameTask'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import ActionParser from './ActionParser'; import DialoguesParser from './DialogueParser'; import LocationsParser from './LocationDetailsParser'; diff --git a/src/features/game/parser/ParserConverter.ts b/src/features/game/parser/ParserConverter.ts index 56b7dcb3bb..2da1b6dfba 100644 --- a/src/features/game/parser/ParserConverter.ts +++ b/src/features/game/parser/ParserConverter.ts @@ -1,9 +1,9 @@ -import { GameActionType } from '../action/GameActionTypes'; -import { GamePosition, GameSize } from '../commons/CommonTypes'; -import { GameItemType } from '../location/GameMapTypes'; -import { GameMode } from '../mode/GameModeTypes'; -import { GameStateStorage, UserStateType } from '../state/GameStateTypes'; -import { mandatory } from '../utils/GameUtils'; +import { GameActionType } from 'src/features/game/action/GameActionTypes'; +import { GamePosition, GameSize } from 'src/features/game/commons/CommonTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import { GameMode } from 'src/features/game/mode/GameModeTypes'; +import { GameStateStorage, UserStateType } from 'src/features/game/state/GameStateTypes'; +import { mandatory } from 'src/features/game/utils/GameUtils'; const stringToSizeMap = { small: GameSize.Small, diff --git a/src/features/game/parser/ParserValidator.ts b/src/features/game/parser/ParserValidator.ts index a58a106b0e..7b8f62bd2f 100644 --- a/src/features/game/parser/ParserValidator.ts +++ b/src/features/game/parser/ParserValidator.ts @@ -1,6 +1,7 @@ -import { ItemId } from '../commons/CommonTypes'; -import { GameItemType } from '../location/GameMapTypes'; -import { GameSoundType } from '../sound/GameSoundTypes'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import { GameItemType } from 'src/features/game/location/GameMapTypes'; +import { GameSoundType } from 'src/features/game/sound/GameSoundTypes'; + import Parser from './Parser'; export enum GameEntityType { diff --git a/src/features/game/parser/PromptParser.ts b/src/features/game/parser/PromptParser.ts index d9055b274f..3c68a7834d 100644 --- a/src/features/game/parser/PromptParser.ts +++ b/src/features/game/parser/PromptParser.ts @@ -1,5 +1,5 @@ -import { Prompt } from '../dialogue/GameDialogueTypes'; -import StringUtils from '../utils/StringUtils'; +import { Prompt } from 'src/features/game/dialogue/GameDialogueTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; /** * This class parses prompt and creates Prompt diff --git a/src/features/game/parser/RoomPreviewParser.ts b/src/features/game/parser/RoomPreviewParser.ts index f04cda4553..edfcbbf4a9 100644 --- a/src/features/game/parser/RoomPreviewParser.ts +++ b/src/features/game/parser/RoomPreviewParser.ts @@ -1,6 +1,6 @@ -import { AssetPath, ItemId } from '../commons/CommonTypes'; -import { toS3Path } from '../utils/GameUtils'; -import StringUtils from '../utils/StringUtils'; +import { AssetPath, ItemId } from 'src/features/game/commons/CommonTypes'; +import { toS3Path } from 'src/features/game/utils/GameUtils'; +import StringUtils from 'src/features/game/utils/StringUtils'; /** * This class parses the roomPreviewMapping.txt, and creates a diff --git a/src/features/game/parser/SpeakerParser.ts b/src/features/game/parser/SpeakerParser.ts index c2963dea86..495be88af0 100644 --- a/src/features/game/parser/SpeakerParser.ts +++ b/src/features/game/parser/SpeakerParser.ts @@ -1,6 +1,7 @@ -import { AssetType } from '../assets/AssetsTypes'; -import { SpeakerDetail } from '../character/GameCharacterTypes'; -import StringUtils from '../utils/StringUtils'; +import { AssetType } from 'src/features/game/assets/AssetsTypes'; +import { SpeakerDetail } from 'src/features/game/character/GameCharacterTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import CharacterParser from './CharacterParser'; import Parser from './Parser'; import ParserConverter from './ParserConverter'; diff --git a/src/features/game/parser/TasksParser.ts b/src/features/game/parser/TasksParser.ts index ed31d7ee5c..c5b2d6c582 100644 --- a/src/features/game/parser/TasksParser.ts +++ b/src/features/game/parser/TasksParser.ts @@ -1,5 +1,6 @@ -import { TaskDetail } from '../task/GameTaskTypes'; -import StringUtils from '../utils/StringUtils'; +import { TaskDetail } from 'src/features/game/task/GameTaskTypes'; +import StringUtils from 'src/features/game/utils/StringUtils'; + import Parser from './Parser'; /** diff --git a/src/features/game/phase/GamePhaseManager.ts b/src/features/game/phase/GamePhaseManager.ts index 90d4477cc5..d2493fc7c4 100644 --- a/src/features/game/phase/GamePhaseManager.ts +++ b/src/features/game/phase/GamePhaseManager.ts @@ -1,6 +1,7 @@ -import { Constants } from '../commons/CommonConstants'; -import { IGameUI } from '../commons/CommonTypes'; -import GameInputManager from '../input/GameInputManager'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { IGameUI } from 'src/features/game/commons/CommonTypes'; +import GameInputManager from 'src/features/game/input/GameInputManager'; + import { GamePhaseType, GameTerminalPhaseType } from './GamePhaseTypes'; /** diff --git a/src/features/game/popUp/GamePopUpConstants.ts b/src/features/game/popUp/GamePopUpConstants.ts index 59a4d29348..87ca0d36f8 100644 --- a/src/features/game/popUp/GamePopUpConstants.ts +++ b/src/features/game/popUp/GamePopUpConstants.ts @@ -1,4 +1,4 @@ -import { screenCenter, screenSize } from '../commons/CommonConstants'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; const popUpXOffset = 400; diff --git a/src/features/game/popUp/GamePopUpManager.ts b/src/features/game/popUp/GamePopUpManager.ts index 7548ff4db3..1b6e41d985 100644 --- a/src/features/game/popUp/GamePopUpManager.ts +++ b/src/features/game/popUp/GamePopUpManager.ts @@ -1,12 +1,13 @@ -import ImageAssets from '../assets/ImageAssets'; -import SoundAssets from '../assets/SoundAssets'; -import { Constants } from '../commons/CommonConstants'; -import { GamePosition, GameSize, ItemId } from '../commons/CommonTypes'; -import { scrollEntry, scrollExit } from '../effects/ScrollEffect'; -import { Layer } from '../layer/GameLayerTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { sleep } from '../utils/GameUtils'; -import { resizeUnderflow } from '../utils/SpriteUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { GamePosition, GameSize, ItemId } from 'src/features/game/commons/CommonTypes'; +import { scrollEntry, scrollExit } from 'src/features/game/effects/ScrollEffect'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { resizeUnderflow } from 'src/features/game/utils/SpriteUtils'; + import PopUpConstants from './GamePopUpConstants'; /** diff --git a/src/features/game/save/GameSaveHelper.ts b/src/features/game/save/GameSaveHelper.ts index 307a39873b..57d0427484 100644 --- a/src/features/game/save/GameSaveHelper.ts +++ b/src/features/game/save/GameSaveHelper.ts @@ -1,6 +1,7 @@ -import { GamePhaseType } from '../phase/GamePhaseTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; + import { FullSaveState, GameSaveState } from './GameSaveTypes'; /** diff --git a/src/features/game/save/GameSaveManager.ts b/src/features/game/save/GameSaveManager.ts index d957d68455..b92f0f0560 100644 --- a/src/features/game/save/GameSaveManager.ts +++ b/src/features/game/save/GameSaveManager.ts @@ -1,6 +1,7 @@ -import GameManager from '../scenes/gameManager/GameManager'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { mandatory } from '../utils/GameUtils'; +import GameManager from 'src/features/game/scenes/gameManager/GameManager'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { mandatory } from 'src/features/game/utils/GameUtils'; + import { createEmptyGameSaveState, createEmptySaveState, gameStateToJson } from './GameSaveHelper'; import { loadData, saveData } from './GameSaveRequests'; import { FullSaveState, GameSaveState, SettingsJson } from './GameSaveTypes'; diff --git a/src/features/game/save/GameSaveRequests.ts b/src/features/game/save/GameSaveRequests.ts index 0df8428cd1..6c4019529c 100644 --- a/src/features/game/save/GameSaveRequests.ts +++ b/src/features/game/save/GameSaveRequests.ts @@ -1,8 +1,8 @@ import _ from 'lodash'; import Constants from 'src/commons/utils/Constants'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { courseId } from 'src/features/game/utils/GameUtils'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { courseId } from '../utils/GameUtils'; import { createEmptySaveState } from './GameSaveHelper'; import { FullSaveState } from './GameSaveTypes'; diff --git a/src/features/game/scenes/awardsHall/AwardsHall.ts b/src/features/game/scenes/awardsHall/AwardsHall.ts index 1a4738e49a..63ac49e96c 100644 --- a/src/features/game/scenes/awardsHall/AwardsHall.ts +++ b/src/features/game/scenes/awardsHall/AwardsHall.ts @@ -1,19 +1,20 @@ -import ImageAssets from '../../assets/ImageAssets'; -import { getAwardProps } from '../../awards/GameAwardsHelper'; -import { AwardProperty } from '../../awards/GameAwardsTypes'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { Constants, screenCenter, screenSize } from '../../commons/CommonConstants'; -import { addLoadingScreen } from '../../effects/LoadingScreen'; -import { putWorkerMessage } from '../../effects/WorkerMessage'; -import GameInputManager from '../../input/GameInputManager'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { createButton } from '../../utils/ButtonUtils'; -import { limitNumber, mandatory } from '../../utils/GameUtils'; -import { resizeUnderflow } from '../../utils/SpriteUtils'; -import { calcTableFormatPos, Direction, HexColor } from '../../utils/StyleUtils'; -import { createBitmapText } from '../../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { getAwardProps } from 'src/features/game/awards/GameAwardsHelper'; +import { AwardProperty } from 'src/features/game/awards/GameAwardsTypes'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { Constants, screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { addLoadingScreen } from 'src/features/game/effects/LoadingScreen'; +import { putWorkerMessage } from 'src/features/game/effects/WorkerMessage'; +import GameInputManager from 'src/features/game/input/GameInputManager'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { limitNumber, mandatory } from 'src/features/game/utils/GameUtils'; +import { resizeUnderflow } from 'src/features/game/utils/SpriteUtils'; +import { calcTableFormatPos, Direction, HexColor } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import { awardBannerTextStyle, awardNoAssetTitleStyle, diff --git a/src/features/game/scenes/awardsHall/AwardsHallConstants.ts b/src/features/game/scenes/awardsHall/AwardsHallConstants.ts index d986c5026d..b56060b660 100644 --- a/src/features/game/scenes/awardsHall/AwardsHallConstants.ts +++ b/src/features/game/scenes/awardsHall/AwardsHallConstants.ts @@ -1,7 +1,7 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; -import { Color } from '../../utils/StyleUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; +import { Color } from 'src/features/game/utils/StyleUtils'; export const AwardsHallConstants = { scrollSpeed: 20, diff --git a/src/features/game/scenes/awardsHall/AwardsHallHelper.ts b/src/features/game/scenes/awardsHall/AwardsHallHelper.ts index a7fb5a83a7..69d62c110c 100644 --- a/src/features/game/scenes/awardsHall/AwardsHallHelper.ts +++ b/src/features/game/scenes/awardsHall/AwardsHallHelper.ts @@ -1,6 +1,7 @@ -import ImageAssets from '../../assets/ImageAssets'; -import { AwardProperty } from '../../awards/GameAwardsTypes'; -import { HexColor } from '../../utils/StyleUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { AwardProperty } from 'src/features/game/awards/GameAwardsTypes'; +import { HexColor } from 'src/features/game/utils/StyleUtils'; + import { awardHoverDescStyle, awardHoverKeyStyle, diff --git a/src/features/game/scenes/bindings/Bindings.ts b/src/features/game/scenes/bindings/Bindings.ts index f955cfcf19..10322b6067 100644 --- a/src/features/game/scenes/bindings/Bindings.ts +++ b/src/features/game/scenes/bindings/Bindings.ts @@ -1,12 +1,13 @@ -import ImageAssets from '../../assets/ImageAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import GameInputManager from '../../input/GameInputManager'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import { mandatory } from '../../utils/GameUtils'; -import { calcListFormatPos } from '../../utils/StyleUtils'; -import { createBitmapText } from '../../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import GameInputManager from 'src/features/game/input/GameInputManager'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { mandatory } from 'src/features/game/utils/GameUtils'; +import { calcListFormatPos } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import { BindingConstants, keyDescStyle, keyStyle } from './BindingsConstants'; /** diff --git a/src/features/game/scenes/bindings/BindingsConstants.ts b/src/features/game/scenes/bindings/BindingsConstants.ts index 62a0a62929..800fa8cd8c 100644 --- a/src/features/game/scenes/bindings/BindingsConstants.ts +++ b/src/features/game/scenes/bindings/BindingsConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenCenter } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const BindingConstants = { keyTextConfig: { x: screenCenter.x - 100, y: 0, oriX: 0.5, oriY: 0.5 }, diff --git a/src/features/game/scenes/chapterSelect/ChapterSelect.ts b/src/features/game/scenes/chapterSelect/ChapterSelect.ts index b1790d9145..85a3cd06f0 100644 --- a/src/features/game/scenes/chapterSelect/ChapterSelect.ts +++ b/src/features/game/scenes/chapterSelect/ChapterSelect.ts @@ -1,15 +1,15 @@ +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { addLoadingScreen } from 'src/features/game/effects/LoadingScreen'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; +import { loadImage } from 'src/features/game/utils/LoaderUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; -import ImageAssets from '../../assets/ImageAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { addLoadingScreen } from '../../effects/LoadingScreen'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { createButton } from '../../utils/ButtonUtils'; -import { loadImage } from '../../utils/LoaderUtils'; -import { createBitmapText } from '../../utils/TextUtils'; import chapConstants, { pageNumberStyle } from './ChapterSelectConstants'; import { createChapter } from './ChapterSelectHelper'; diff --git a/src/features/game/scenes/chapterSelect/ChapterSelectConstants.ts b/src/features/game/scenes/chapterSelect/ChapterSelectConstants.ts index a8c2d6095a..63dd13e18f 100644 --- a/src/features/game/scenes/chapterSelect/ChapterSelectConstants.ts +++ b/src/features/game/scenes/chapterSelect/ChapterSelectConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const chapterIndexStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/scenes/chapterSelect/ChapterSelectHelper.ts b/src/features/game/scenes/chapterSelect/ChapterSelectHelper.ts index fa0937e484..9727a86b41 100644 --- a/src/features/game/scenes/chapterSelect/ChapterSelectHelper.ts +++ b/src/features/game/scenes/chapterSelect/ChapterSelectHelper.ts @@ -1,11 +1,12 @@ -import ImageAssets from '../../assets/ImageAssets'; -import { GameChapter } from '../../chapter/GameChapterTypes'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import CommonTextHover from '../../commons/CommonTextHover'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { createButton } from '../../utils/ButtonUtils'; -import { createBitmapText } from '../../utils/TextUtils'; -import { callGameManagerOnTxtLoad } from '../../utils/TxtLoaderUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { GameChapter } from 'src/features/game/chapter/GameChapterTypes'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import CommonTextHover from 'src/features/game/commons/CommonTextHover'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; +import { callGameManagerOnTxtLoad } from 'src/features/game/utils/TxtLoaderUtils'; + import ChapterSelect from './ChapterSelect'; import chapConstants, { chapterIndexStyle, chapterTitleStyle } from './ChapterSelectConstants'; diff --git a/src/features/game/scenes/checkpointTransition/CheckpointTransition.ts b/src/features/game/scenes/checkpointTransition/CheckpointTransition.ts index 13d63988f7..372d2ff89a 100644 --- a/src/features/game/scenes/checkpointTransition/CheckpointTransition.ts +++ b/src/features/game/scenes/checkpointTransition/CheckpointTransition.ts @@ -1,8 +1,12 @@ -import { GameChapter } from '../../chapter/GameChapterTypes'; -import SourceAcademyGame, { GameType } from '../../SourceAcademyGame'; -import { sleep } from '../../utils/GameUtils'; -import { createBitmapText } from '../../utils/TextUtils'; -import { callGameManagerForSim, callGameManagerOnTxtLoad } from '../../utils/TxtLoaderUtils'; +import { GameChapter } from 'src/features/game/chapter/GameChapterTypes'; +import SourceAcademyGame, { GameType } from 'src/features/game/SourceAcademyGame'; +import { sleep } from 'src/features/game/utils/GameUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; +import { + callGameManagerForSim, + callGameManagerOnTxtLoad +} from 'src/features/game/utils/TxtLoaderUtils'; + import CheckpointConstants, { transitionTextStyle } from './CheckpointTransitionConstants'; /** diff --git a/src/features/game/scenes/checkpointTransition/CheckpointTransitionConstants.ts b/src/features/game/scenes/checkpointTransition/CheckpointTransitionConstants.ts index d1267c323b..9075f567c0 100644 --- a/src/features/game/scenes/checkpointTransition/CheckpointTransitionConstants.ts +++ b/src/features/game/scenes/checkpointTransition/CheckpointTransitionConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenCenter } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const transitionTextStyle: BitmapFontStyle = { key: FontAssets.alienCowsFont.key, diff --git a/src/features/game/scenes/entry/Entry.ts b/src/features/game/scenes/entry/Entry.ts index 67f7b0ec9f..93622c8479 100644 --- a/src/features/game/scenes/entry/Entry.ts +++ b/src/features/game/scenes/entry/Entry.ts @@ -1,13 +1,13 @@ -import FontAssets from '../../assets/FontAssets'; -import ImageAssets from '../../assets/ImageAssets'; -import SoundAssets from '../../assets/SoundAssets'; -import TextAssets from '../../assets/TextAssets'; -import { addLoadingScreen } from '../../effects/LoadingScreen'; -import AwardParser from '../../parser/AwardParser'; -import RoomPreviewParser from '../../parser/RoomPreviewParser'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { toS3Path } from '../../utils/GameUtils'; -import { loadImage } from '../../utils/LoaderUtils'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import TextAssets from 'src/features/game/assets/TextAssets'; +import { addLoadingScreen } from 'src/features/game/effects/LoadingScreen'; +import AwardParser from 'src/features/game/parser/AwardParser'; +import RoomPreviewParser from 'src/features/game/parser/RoomPreviewParser'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { toS3Path } from 'src/features/game/utils/GameUtils'; +import { loadImage } from 'src/features/game/utils/LoaderUtils'; /** * User entry point into the game. diff --git a/src/features/game/scenes/gameManager/GameGlobalAPI.ts b/src/features/game/scenes/gameManager/GameGlobalAPI.ts index 0be52dd764..87cd2f410c 100644 --- a/src/features/game/scenes/gameManager/GameGlobalAPI.ts +++ b/src/features/game/scenes/gameManager/GameGlobalAPI.ts @@ -1,24 +1,30 @@ -import { GameAction } from '../../action/GameActionTypes'; -import { SoundAsset } from '../../assets/AssetsTypes'; -import { getAwardProp } from '../../awards/GameAwardsHelper'; -import { BBoxProperty } from '../../boundingBoxes/GameBoundingBoxTypes'; -import { Character, SpeakerDetail } from '../../character/GameCharacterTypes'; -import { GamePosition, GameSize, ItemId } from '../../commons/CommonTypes'; -import { AssetKey } from '../../commons/CommonTypes'; -import { Dialogue } from '../../dialogue/GameDialogueTypes'; -import { displayMiniMessage } from '../../effects/MiniMessage'; -import { displayNotification } from '../../effects/Notification'; -import { promptWithChoices } from '../../effects/Prompt'; -import { Layer } from '../../layer/GameLayerTypes'; -import { AnyId, GameItemType, GameLocation, LocationId } from '../../location/GameMapTypes'; -import { GameMode } from '../../mode/GameModeTypes'; -import { ObjectProperty } from '../../objects/GameObjectTypes'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import { SettingsJson } from '../../save/GameSaveTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { StateObserver, UserStateType } from '../../state/GameStateTypes'; -import { TaskDetail } from '../../task/GameTaskTypes'; -import { courseId, mandatory } from '../../utils/GameUtils'; +import { GameAction } from 'src/features/game/action/GameActionTypes'; +import { SoundAsset } from 'src/features/game/assets/AssetsTypes'; +import { getAwardProp } from 'src/features/game/awards/GameAwardsHelper'; +import { BBoxProperty } from 'src/features/game/boundingBoxes/GameBoundingBoxTypes'; +import { Character, SpeakerDetail } from 'src/features/game/character/GameCharacterTypes'; +import { GamePosition, GameSize, ItemId } from 'src/features/game/commons/CommonTypes'; +import { AssetKey } from 'src/features/game/commons/CommonTypes'; +import { Dialogue } from 'src/features/game/dialogue/GameDialogueTypes'; +import { displayMiniMessage } from 'src/features/game/effects/MiniMessage'; +import { displayNotification } from 'src/features/game/effects/Notification'; +import { promptWithChoices } from 'src/features/game/effects/Prompt'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { + AnyId, + GameItemType, + GameLocation, + LocationId +} from 'src/features/game/location/GameMapTypes'; +import { GameMode } from 'src/features/game/mode/GameModeTypes'; +import { ObjectProperty } from 'src/features/game/objects/GameObjectTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import { SettingsJson } from 'src/features/game/save/GameSaveTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { StateObserver, UserStateType } from 'src/features/game/state/GameStateTypes'; +import { TaskDetail } from 'src/features/game/task/GameTaskTypes'; +import { courseId, mandatory } from 'src/features/game/utils/GameUtils'; + import GameManager from './GameManager'; /** diff --git a/src/features/game/scenes/gameManager/GameManager.ts b/src/features/game/scenes/gameManager/GameManager.ts index a02542df79..1c1e429813 100644 --- a/src/features/game/scenes/gameManager/GameManager.ts +++ b/src/features/game/scenes/gameManager/GameManager.ts @@ -1,34 +1,35 @@ -import GameActionManager from '../../action/GameActionManager'; -import GameAnimationManager from '../../animations/GameAnimationManager'; -import { AssetType, ImageAsset } from '../../assets/AssetsTypes'; -import GameAwardsManager from '../../awards/GameAwardsManager'; -import GameBackgroundManager from '../../background/GameBackgroundManager'; -import GameBBoxManager from '../../boundingBoxes/GameBoundingBoxManager'; -import { GameCheckpoint } from '../../chapter/GameChapterTypes'; -import GameCharacterManager from '../../character/GameCharacterManager'; -import { Constants } from '../../commons/CommonConstants'; -import { AssetKey } from '../../commons/CommonTypes'; -import GameDashboardManager from '../../dashboard/GameDashboardManager'; -import { DashboardPage } from '../../dashboard/GameDashboardTypes'; -import GameDialogueManager from '../../dialogue/GameDialogueManager'; -import GameDialogueStorageManager from '../../dialogue/GameDialogueStorageManager'; -import { blackFade, blackScreen, fadeIn } from '../../effects/FadeEffect'; -import { addLoadingScreen } from '../../effects/LoadingScreen'; -import GameEscapeManager from '../../escape/GameEscapeManager'; -import GameInputManager from '../../input/GameInputManager'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import { LocationId } from '../../location/GameMapTypes'; -import GameLogManager from '../../log/GameLogManager'; -import GameObjectManager from '../../objects/GameObjectManager'; -import GamePhaseManager from '../../phase/GamePhaseManager'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import GamePopUpManager from '../../popUp/GamePopUpManager'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import GameStateManager from '../../state/GameStateManager'; -import GameTaskLogManager from '../../task/GameTaskLogManager'; -import GameToolbarManager from '../../toolbar/GameToolbarManager'; -import { mandatory, sleep, toS3Path } from '../../utils/GameUtils'; +import GameActionManager from 'src/features/game/action/GameActionManager'; +import GameAnimationManager from 'src/features/game/animations/GameAnimationManager'; +import { AssetType, ImageAsset } from 'src/features/game/assets/AssetsTypes'; +import GameAwardsManager from 'src/features/game/awards/GameAwardsManager'; +import GameBackgroundManager from 'src/features/game/background/GameBackgroundManager'; +import GameBBoxManager from 'src/features/game/boundingBoxes/GameBoundingBoxManager'; +import { GameCheckpoint } from 'src/features/game/chapter/GameChapterTypes'; +import GameCharacterManager from 'src/features/game/character/GameCharacterManager'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { AssetKey } from 'src/features/game/commons/CommonTypes'; +import GameDashboardManager from 'src/features/game/dashboard/GameDashboardManager'; +import { DashboardPage } from 'src/features/game/dashboard/GameDashboardTypes'; +import GameDialogueManager from 'src/features/game/dialogue/GameDialogueManager'; +import GameDialogueStorageManager from 'src/features/game/dialogue/GameDialogueStorageManager'; +import { blackFade, blackScreen, fadeIn } from 'src/features/game/effects/FadeEffect'; +import { addLoadingScreen } from 'src/features/game/effects/LoadingScreen'; +import GameEscapeManager from 'src/features/game/escape/GameEscapeManager'; +import GameInputManager from 'src/features/game/input/GameInputManager'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { LocationId } from 'src/features/game/location/GameMapTypes'; +import GameLogManager from 'src/features/game/log/GameLogManager'; +import GameObjectManager from 'src/features/game/objects/GameObjectManager'; +import GamePhaseManager from 'src/features/game/phase/GamePhaseManager'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import GamePopUpManager from 'src/features/game/popUp/GamePopUpManager'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import GameStateManager from 'src/features/game/state/GameStateManager'; +import GameTaskLogManager from 'src/features/game/task/GameTaskLogManager'; +import GameToolbarManager from 'src/features/game/toolbar/GameToolbarManager'; +import { mandatory, sleep, toS3Path } from 'src/features/game/utils/GameUtils'; + import GameGlobalAPI from './GameGlobalAPI'; import { createGamePhases } from './GameManagerHelper'; diff --git a/src/features/game/scenes/gameManager/GameManagerHelper.ts b/src/features/game/scenes/gameManager/GameManagerHelper.ts index 59d02e881b..ceb65a758b 100644 --- a/src/features/game/scenes/gameManager/GameManagerHelper.ts +++ b/src/features/game/scenes/gameManager/GameManagerHelper.ts @@ -1,9 +1,9 @@ -import GameModeExplore from '../../mode/explore/GameModeExplore'; -import GameModeMenu from '../../mode/menu/GameModeMenu'; -import GameModeMove from '../../mode/move/GameModeMove'; -import GameModeSequence from '../../mode/sequence/GameModeSequence'; -import GameModeTalk from '../../mode/talk/GameModeTalk'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; +import GameModeExplore from 'src/features/game/mode/explore/GameModeExplore'; +import GameModeMenu from 'src/features/game/mode/menu/GameModeMenu'; +import GameModeMove from 'src/features/game/mode/move/GameModeMove'; +import GameModeSequence from 'src/features/game/mode/sequence/GameModeSequence'; +import GameModeTalk from 'src/features/game/mode/talk/GameModeTalk'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; /** * Game Manager phases, for the phase manager. diff --git a/src/features/game/scenes/mainMenu/MainMenu.ts b/src/features/game/scenes/mainMenu/MainMenu.ts index 8e41daf907..638d21b023 100644 --- a/src/features/game/scenes/mainMenu/MainMenu.ts +++ b/src/features/game/scenes/mainMenu/MainMenu.ts @@ -1,14 +1,15 @@ -import ImageAssets from '../../assets/ImageAssets'; -import SoundAssets from '../../assets/SoundAssets'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { blackScreen } from '../../effects/FadeEffect'; -import { putWorkerMessage } from '../../effects/WorkerMessage'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { createButton } from '../../utils/ButtonUtils'; -import { mandatory } from '../../utils/GameUtils'; -import { calcTableFormatPos, Direction } from '../../utils/StyleUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { blackScreen } from 'src/features/game/effects/FadeEffect'; +import { putWorkerMessage } from 'src/features/game/effects/WorkerMessage'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { mandatory } from 'src/features/game/utils/GameUtils'; +import { calcTableFormatPos, Direction } from 'src/features/game/utils/StyleUtils'; + import MainMenuConstants, { mainMenuStyle } from './MainMenuConstants'; /** diff --git a/src/features/game/scenes/mainMenu/MainMenuConstants.ts b/src/features/game/scenes/mainMenu/MainMenuConstants.ts index 5c6f647370..3291b9b06d 100644 --- a/src/features/game/scenes/mainMenu/MainMenuConstants.ts +++ b/src/features/game/scenes/mainMenu/MainMenuConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const mainMenuStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/scenes/roomPreview/RoomPreview.ts b/src/features/game/scenes/roomPreview/RoomPreview.ts index 1970a1aaa4..d0b266b14b 100644 --- a/src/features/game/scenes/roomPreview/RoomPreview.ts +++ b/src/features/game/scenes/roomPreview/RoomPreview.ts @@ -1,28 +1,28 @@ import { Context, runInContext } from 'js-slang'; import { Chapter, Variant } from 'js-slang/dist/types'; import { createContext } from 'src/commons/utils/JsSlangHelper'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { getAwardProp } from 'src/features/game/awards/GameAwardsHelper'; +import GameAwardsManager from 'src/features/game/awards/GameAwardsManager'; +import { Constants, screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import CommonTextHover from 'src/features/game/commons/CommonTextHover'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import GameDashboardManager from 'src/features/game/dashboard/GameDashboardManager'; +import { DashboardPage } from 'src/features/game/dashboard/GameDashboardTypes'; +import { addLoadingScreen } from 'src/features/game/effects/LoadingScreen'; +import GameEscapeManager from 'src/features/game/escape/GameEscapeManager'; +import GameInputManager from 'src/features/game/input/GameInputManager'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import GamePhaseManager from 'src/features/game/phase/GamePhaseManager'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import GameToolbarManager from 'src/features/game/toolbar/GameToolbarManager'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; +import { loadImage, loadSound, loadSpritesheet } from 'src/features/game/utils/LoaderUtils'; +import { resizeOverflow } from 'src/features/game/utils/SpriteUtils'; -import ImageAssets from '../../assets/ImageAssets'; -import { getAwardProp } from '../../awards/GameAwardsHelper'; -import GameAwardsManager from '../../awards/GameAwardsManager'; -import { Constants, screenCenter, screenSize } from '../../commons/CommonConstants'; -import CommonTextHover from '../../commons/CommonTextHover'; -import { ItemId } from '../../commons/CommonTypes'; -import GameDashboardManager from '../../dashboard/GameDashboardManager'; -import { DashboardPage } from '../../dashboard/GameDashboardTypes'; -import { addLoadingScreen } from '../../effects/LoadingScreen'; -import GameEscapeManager from '../../escape/GameEscapeManager'; -import GameInputManager from '../../input/GameInputManager'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import GamePhaseManager from '../../phase/GamePhaseManager'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import GameToolbarManager from '../../toolbar/GameToolbarManager'; -import { createButton } from '../../utils/ButtonUtils'; -import { mandatory, toS3Path } from '../../utils/GameUtils'; -import { loadImage, loadSound, loadSpritesheet } from '../../utils/LoaderUtils'; -import { resizeOverflow } from '../../utils/SpriteUtils'; import { RoomConstants, roomDefaultCode } from './RoomPreviewConstants'; import { createCMRGamePhases, createVerifiedHoverContainer } from './RoomPreviewHelper'; diff --git a/src/features/game/scenes/roomPreview/RoomPreviewConstants.ts b/src/features/game/scenes/roomPreview/RoomPreviewConstants.ts index 5cd2a9a982..9454397d2a 100644 --- a/src/features/game/scenes/roomPreview/RoomPreviewConstants.ts +++ b/src/features/game/scenes/roomPreview/RoomPreviewConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const roomDefaultCode = ` import { prepend_remote_url, get_screen_width, get_screen_height, load_image, create_image, create_text, create_rect, add, set_display_size, set_alpha, set_origin } from 'game'; diff --git a/src/features/game/scenes/roomPreview/RoomPreviewHelper.ts b/src/features/game/scenes/roomPreview/RoomPreviewHelper.ts index e5e7a8773f..6fbf9e9188 100644 --- a/src/features/game/scenes/roomPreview/RoomPreviewHelper.ts +++ b/src/features/game/scenes/roomPreview/RoomPreviewHelper.ts @@ -1,12 +1,12 @@ import { Assessment, IProgrammingQuestion } from 'src/commons/assessment/AssessmentTypes'; import { getAssessment, getAssessmentOverviews } from 'src/commons/sagas/RequestsSaga'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import GameModeSequence from 'src/features/game/mode/sequence/GameModeSequence'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { HexColor } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; -import ImageAssets from '../../assets/ImageAssets'; -import GameModeSequence from '../../mode/sequence/GameModeSequence'; -import { GamePhaseType } from '../../phase/GamePhaseTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { HexColor } from '../../utils/StyleUtils'; -import { createBitmapText } from '../../utils/TextUtils'; import RoomPreview from './RoomPreview'; import { RoomConstants, roomDefaultCode, verifiedStyle } from './RoomPreviewConstants'; diff --git a/src/features/game/scenes/settings/Settings.ts b/src/features/game/scenes/settings/Settings.ts index 51a698372f..fa31526593 100644 --- a/src/features/game/scenes/settings/Settings.ts +++ b/src/features/game/scenes/settings/Settings.ts @@ -1,14 +1,15 @@ -import ImageAssets from '../../assets/ImageAssets'; -import CommonBackButton from '../../commons/CommonBackButton'; -import { screenCenter, screenSize } from '../../commons/CommonConstants'; -import CommonRadioButton from '../../commons/CommonRadioButton'; -import GameLayerManager from '../../layer/GameLayerManager'; -import { Layer } from '../../layer/GameLayerTypes'; -import SourceAcademyGame from '../../SourceAcademyGame'; -import { createButton } from '../../utils/ButtonUtils'; -import { mandatory } from '../../utils/GameUtils'; -import { calcTableFormatPos, Direction } from '../../utils/StyleUtils'; -import { createBitmapText } from '../../utils/TextUtils'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import CommonBackButton from 'src/features/game/commons/CommonBackButton'; +import { screenCenter, screenSize } from 'src/features/game/commons/CommonConstants'; +import CommonRadioButton from 'src/features/game/commons/CommonRadioButton'; +import GameLayerManager from 'src/features/game/layer/GameLayerManager'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; +import { mandatory } from 'src/features/game/utils/GameUtils'; +import { calcTableFormatPos, Direction } from 'src/features/game/utils/StyleUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import SettingsConstants, { applySettingsTextStyle, optionHeaderTextStyle, diff --git a/src/features/game/scenes/settings/SettingsConstants.ts b/src/features/game/scenes/settings/SettingsConstants.ts index ec83747422..169cb505fe 100644 --- a/src/features/game/scenes/settings/SettingsConstants.ts +++ b/src/features/game/scenes/settings/SettingsConstants.ts @@ -1,6 +1,6 @@ -import FontAssets from '../../assets/FontAssets'; -import { screenSize } from '../../commons/CommonConstants'; -import { BitmapFontStyle } from '../../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const optionTextStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/sound/GameSoundManager.ts b/src/features/game/sound/GameSoundManager.ts index 8ae17c78d8..cd94fe5604 100644 --- a/src/features/game/sound/GameSoundManager.ts +++ b/src/features/game/sound/GameSoundManager.ts @@ -1,9 +1,10 @@ -import { AssetMap, SoundAsset } from '../assets/AssetsTypes'; -import { Constants } from '../commons/CommonConstants'; -import { AssetKey, AssetPath } from '../commons/CommonTypes'; -import { SettingsJson } from '../save/GameSaveTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; -import { mandatory, toS3Path } from '../utils/GameUtils'; +import { AssetMap, SoundAsset } from 'src/features/game/assets/AssetsTypes'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { AssetKey, AssetPath } from 'src/features/game/commons/CommonTypes'; +import { SettingsJson } from 'src/features/game/save/GameSaveTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; + import { bgMusicFadeDuration, musicFadeOutTween } from './GameSoundTypes'; /** diff --git a/src/features/game/state/GameStateConstants.ts b/src/features/game/state/GameStateConstants.ts index 4b137cec3c..e958471e8f 100644 --- a/src/features/game/state/GameStateConstants.ts +++ b/src/features/game/state/GameStateConstants.ts @@ -1,5 +1,5 @@ -import FontAssets from '../assets/FontAssets'; -import { BitmapFontStyle } from '../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const emptyUserState = { collectibles: [], diff --git a/src/features/game/state/GameStateManager.ts b/src/features/game/state/GameStateManager.ts index 5cb0ecc1ce..9e1d3b5c54 100644 --- a/src/features/game/state/GameStateManager.ts +++ b/src/features/game/state/GameStateManager.ts @@ -1,17 +1,18 @@ -import { BBoxProperty } from '../boundingBoxes/GameBoundingBoxTypes'; -import { GameCheckpoint } from '../chapter/GameChapterTypes'; -import { GamePosition, ItemId } from '../commons/CommonTypes'; -import GameMap from '../location/GameMap'; -import { GameItemType, LocationId } from '../location/GameMapTypes'; -import { GameMode } from '../mode/GameModeTypes'; -import GameObjective from '../objective/GameObjective'; -import { ObjectProperty } from '../objects/GameObjectTypes'; -import { convertMapToArray } from '../save/GameSaveHelper'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame from '../SourceAcademyGame'; -import GameTask from '../task/GameTask'; -import { TaskDetail } from '../task/GameTaskTypes'; -import { mandatory } from '../utils/GameUtils'; +import { BBoxProperty } from 'src/features/game/boundingBoxes/GameBoundingBoxTypes'; +import { GameCheckpoint } from 'src/features/game/chapter/GameChapterTypes'; +import { GamePosition, ItemId } from 'src/features/game/commons/CommonTypes'; +import GameMap from 'src/features/game/location/GameMap'; +import { GameItemType, LocationId } from 'src/features/game/location/GameMapTypes'; +import { GameMode } from 'src/features/game/mode/GameModeTypes'; +import GameObjective from 'src/features/game/objective/GameObjective'; +import { ObjectProperty } from 'src/features/game/objects/GameObjectTypes'; +import { convertMapToArray } from 'src/features/game/save/GameSaveHelper'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import GameTask from 'src/features/game/task/GameTask'; +import { TaskDetail } from 'src/features/game/task/GameTaskTypes'; +import { mandatory } from 'src/features/game/utils/GameUtils'; + import { StateObserver } from './GameStateTypes'; /** diff --git a/src/features/game/state/GameStateTypes.ts b/src/features/game/state/GameStateTypes.ts index afb85031e5..c4a167443d 100644 --- a/src/features/game/state/GameStateTypes.ts +++ b/src/features/game/state/GameStateTypes.ts @@ -1,4 +1,4 @@ -import { ItemId } from '../commons/CommonTypes'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; export enum GameStateStorage { UserState = 'UserState', diff --git a/src/features/game/state/GameUserStateManager.ts b/src/features/game/state/GameUserStateManager.ts index 77c8a400f4..8672ee5990 100644 --- a/src/features/game/state/GameUserStateManager.ts +++ b/src/features/game/state/GameUserStateManager.ts @@ -1,11 +1,11 @@ import { getAssessmentOverviews } from 'src/commons/sagas/RequestsSaga'; import { AchievementGoal } from 'src/features/achievement/AchievementTypes'; +import { ItemId } from 'src/features/game/commons/CommonTypes'; +import { promptWithChoices } from 'src/features/game/effects/Prompt'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import SourceAcademyGame, { GameType } from 'src/features/game/SourceAcademyGame'; +import StringUtils from 'src/features/game/utils/StringUtils'; -import { ItemId } from '../commons/CommonTypes'; -import { promptWithChoices } from '../effects/Prompt'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import SourceAcademyGame, { GameType } from '../SourceAcademyGame'; -import StringUtils from '../utils/StringUtils'; import { UserStateType } from './GameStateTypes'; /** diff --git a/src/features/game/task/GameTaskLogConstants.ts b/src/features/game/task/GameTaskLogConstants.ts index eeeb9ce1f2..67b74ea340 100644 --- a/src/features/game/task/GameTaskLogConstants.ts +++ b/src/features/game/task/GameTaskLogConstants.ts @@ -1,7 +1,7 @@ -import FontAssets from '../assets/FontAssets'; -import ImageAssets from '../assets/ImageAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { BitmapFontStyle } from '../commons/CommonTypes'; +import FontAssets from 'src/features/game/assets/FontAssets'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { BitmapFontStyle } from 'src/features/game/commons/CommonTypes'; export const taskTextStyle: BitmapFontStyle = { key: FontAssets.zektonFont.key, diff --git a/src/features/game/task/GameTaskLogManager.ts b/src/features/game/task/GameTaskLogManager.ts index eacd019c59..d2c47a17b5 100644 --- a/src/features/game/task/GameTaskLogManager.ts +++ b/src/features/game/task/GameTaskLogManager.ts @@ -1,9 +1,10 @@ -import { IBaseScene } from '../commons/CommonTypes'; -import DashboardConstants from '../dashboard/GameDashboardConstants'; -import { DashboardPageManager } from '../dashboard/GameDashboardTypes'; -import GameGlobalAPI from '../scenes/gameManager/GameGlobalAPI'; -import { limitNumber } from '../utils/GameUtils'; -import { createBitmapText } from '../utils/TextUtils'; +import { IBaseScene } from 'src/features/game/commons/CommonTypes'; +import DashboardConstants from 'src/features/game/dashboard/GameDashboardConstants'; +import { DashboardPageManager } from 'src/features/game/dashboard/GameDashboardTypes'; +import GameGlobalAPI from 'src/features/game/scenes/gameManager/GameGlobalAPI'; +import { limitNumber } from 'src/features/game/utils/GameUtils'; +import { createBitmapText } from 'src/features/game/utils/TextUtils'; + import TaskLogConstants, { taskTextStyle } from './GameTaskLogConstants'; /** diff --git a/src/features/game/toolbar/GameToolbarConstants.ts b/src/features/game/toolbar/GameToolbarConstants.ts index 1fcb5c0f91..5e5a879216 100644 --- a/src/features/game/toolbar/GameToolbarConstants.ts +++ b/src/features/game/toolbar/GameToolbarConstants.ts @@ -1,7 +1,7 @@ -import ImageAssets from '../assets/ImageAssets'; -import { screenSize } from '../commons/CommonConstants'; -import { AssetKey, IBaseScene } from '../commons/CommonTypes'; -import { GamePhaseType } from '../phase/GamePhaseTypes'; +import ImageAssets from 'src/features/game/assets/ImageAssets'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; +import { AssetKey, IBaseScene } from 'src/features/game/commons/CommonTypes'; +import { GamePhaseType } from 'src/features/game/phase/GamePhaseTypes'; export type ToolbarButtonConfig = { assetKey: AssetKey; diff --git a/src/features/game/toolbar/GameToolbarManager.ts b/src/features/game/toolbar/GameToolbarManager.ts index ba47492ecb..1b662497ca 100644 --- a/src/features/game/toolbar/GameToolbarManager.ts +++ b/src/features/game/toolbar/GameToolbarManager.ts @@ -1,6 +1,7 @@ -import { IBaseScene } from '../commons/CommonTypes'; -import { Layer } from '../layer/GameLayerTypes'; -import { createButton } from '../utils/ButtonUtils'; +import { IBaseScene } from 'src/features/game/commons/CommonTypes'; +import { Layer } from 'src/features/game/layer/GameLayerTypes'; +import { createButton } from 'src/features/game/utils/ButtonUtils'; + import ToolbarConstants, { ToolbarButtonConfig } from './GameToolbarConstants'; /** diff --git a/src/features/game/utils/ButtonUtils.ts b/src/features/game/utils/ButtonUtils.ts index e3f8cb361d..428207217b 100644 --- a/src/features/game/utils/ButtonUtils.ts +++ b/src/features/game/utils/ButtonUtils.ts @@ -1,7 +1,8 @@ -import SoundAssets from '../assets/SoundAssets'; -import { Constants } from '../commons/CommonConstants'; -import { AssetKey, BitmapFontStyle, TextConfig } from '../commons/CommonTypes'; -import SourceAcademyGame from '../SourceAcademyGame'; +import SoundAssets from 'src/features/game/assets/SoundAssets'; +import { Constants } from 'src/features/game/commons/CommonConstants'; +import { AssetKey, BitmapFontStyle, TextConfig } from 'src/features/game/commons/CommonTypes'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; + import { createBitmapText } from './TextUtils'; type ButtonConfig = { diff --git a/src/features/game/utils/GameUtils.ts b/src/features/game/utils/GameUtils.ts index 76852077ad..b75965500e 100644 --- a/src/features/game/utils/GameUtils.ts +++ b/src/features/game/utils/GameUtils.ts @@ -1,7 +1,6 @@ +import { Constants } from 'src/features/game/commons/CommonConstants'; import { store } from 'src/pages/createStore'; -import { Constants } from '../commons/CommonConstants'; - /** * When called with await in an async function, * e.g. "await sleep(5000)", this line delays diff --git a/src/features/game/utils/StringUtils.ts b/src/features/game/utils/StringUtils.ts index e36200695d..55bf97a159 100644 --- a/src/features/game/utils/StringUtils.ts +++ b/src/features/game/utils/StringUtils.ts @@ -1,4 +1,4 @@ -import { Constants } from '../commons/CommonConstants'; +import { Constants } from 'src/features/game/commons/CommonConstants'; export default class StringUtils { /** diff --git a/src/features/game/utils/StyleUtils.ts b/src/features/game/utils/StyleUtils.ts index ab7e078837..b9c77f1e74 100644 --- a/src/features/game/utils/StyleUtils.ts +++ b/src/features/game/utils/StyleUtils.ts @@ -1,6 +1,5 @@ import * as _ from 'lodash'; - -import { screenSize } from '../commons/CommonConstants'; +import { screenSize } from 'src/features/game/commons/CommonConstants'; export const Color = { navy: '#03092c', diff --git a/src/features/game/utils/TextUtils.ts b/src/features/game/utils/TextUtils.ts index d170dee673..9d856a8aa6 100644 --- a/src/features/game/utils/TextUtils.ts +++ b/src/features/game/utils/TextUtils.ts @@ -1,4 +1,4 @@ -import { BitmapFontStyle, TextConfig } from '../commons/CommonTypes'; +import { BitmapFontStyle, TextConfig } from 'src/features/game/commons/CommonTypes'; /** * Create bitmap text with the given style. diff --git a/src/features/game/utils/TxtLoaderUtils.ts b/src/features/game/utils/TxtLoaderUtils.ts index 0dcb1e55af..eda6712d08 100644 --- a/src/features/game/utils/TxtLoaderUtils.ts +++ b/src/features/game/utils/TxtLoaderUtils.ts @@ -1,6 +1,7 @@ -import TextAssets, { MockTextAssets, toTxtPath } from '../assets/TextAssets'; -import Parser from '../parser/Parser'; -import SourceAcademyGame from '../SourceAcademyGame'; +import TextAssets, { MockTextAssets, toTxtPath } from 'src/features/game/assets/TextAssets'; +import Parser from 'src/features/game/parser/Parser'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; + import { loadText } from './LoaderUtils'; /** diff --git a/src/features/github/GitHubUtils.tsx b/src/features/github/GitHubUtils.tsx index 21866465b4..b9b5dbdcbc 100644 --- a/src/features/github/GitHubUtils.tsx +++ b/src/features/github/GitHubUtils.tsx @@ -3,14 +3,13 @@ import { GetResponseDataTypeFromEndpointMethod, GetResponseTypeFromEndpointMethod } from '@octokit/types'; - -import { actions } from '../../commons/utils/ActionsHelper'; -import { showSimpleConfirmDialog } from '../../commons/utils/DialogHelper'; +import { actions } from 'src/commons/utils/ActionsHelper'; +import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; import { showSuccessMessage, showWarningMessage -} from '../../commons/utils/notifications/NotificationsHelper'; -import { store } from '../../pages/createStore'; +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { store } from 'src/pages/createStore'; /** * Exchanges the Access Code with the back-end to receive an Auth-Token diff --git a/src/features/githubAssessment/GitHubAssessmentTypes.ts b/src/features/githubAssessment/GitHubAssessmentTypes.ts index 04403f058c..ae446939f4 100644 --- a/src/features/githubAssessment/GitHubAssessmentTypes.ts +++ b/src/features/githubAssessment/GitHubAssessmentTypes.ts @@ -1,4 +1,4 @@ -import { WorkspaceState } from '../../commons/workspace/WorkspaceTypes'; +import { WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; export type GitHubAssessmentWorkspaceAttr = { hasUnsavedChanges: boolean; diff --git a/src/features/grading/GradingTypes.ts b/src/features/grading/GradingTypes.ts index 80e5938516..f12fe6eafe 100644 --- a/src/features/grading/GradingTypes.ts +++ b/src/features/grading/GradingTypes.ts @@ -5,8 +5,8 @@ import { MCQChoice, Question, Testcase -} from '../../commons/assessment/AssessmentTypes'; -import { Notification } from '../../commons/notificationBadge/NotificationBadgeTypes'; +} from 'src/commons/assessment/AssessmentTypes'; +import { Notification } from 'src/commons/notificationBadge/NotificationBadgeTypes'; /** * Information on a Grading, for a particular student submission diff --git a/src/features/playground/PlaygroundActions.ts b/src/features/playground/PlaygroundActions.ts index 2be26fbf99..9aaa6629df 100644 --- a/src/features/playground/PlaygroundActions.ts +++ b/src/features/playground/PlaygroundActions.ts @@ -1,7 +1,7 @@ import { SALanguage } from 'src/commons/application/ApplicationTypes'; +import { PersistenceFile } from 'src/features/persistence/PersistenceTypes'; import { action } from 'typesafe-actions'; -import { PersistenceFile } from '../persistence/PersistenceTypes'; import { CHANGE_QUERY_STRING, GENERATE_LZ_STRING, diff --git a/src/features/playground/PlaygroundReducer.ts b/src/features/playground/PlaygroundReducer.ts index 16bd7d4986..f51d4f4228 100644 --- a/src/features/playground/PlaygroundReducer.ts +++ b/src/features/playground/PlaygroundReducer.ts @@ -1,7 +1,7 @@ import { Reducer } from 'redux'; +import { defaultPlayground } from 'src/commons/application/ApplicationTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; -import { defaultPlayground } from '../../commons/application/ApplicationTypes'; -import { SourceActionType } from '../../commons/utils/ActionsHelper'; import { CHANGE_QUERY_STRING, PLAYGROUND_UPDATE_GITHUB_SAVE_INFO, diff --git a/src/features/playground/PlaygroundTypes.ts b/src/features/playground/PlaygroundTypes.ts index 69655a64b3..9ab77ddaec 100644 --- a/src/features/playground/PlaygroundTypes.ts +++ b/src/features/playground/PlaygroundTypes.ts @@ -1,7 +1,6 @@ import { SALanguage } from 'src/commons/application/ApplicationTypes'; - -import { GitHubSaveInfo } from '../github/GitHubTypes'; -import { PersistenceFile } from '../persistence/PersistenceTypes'; +import { GitHubSaveInfo } from 'src/features/github/GitHubTypes'; +import { PersistenceFile } from 'src/features/persistence/PersistenceTypes'; export const CHANGE_QUERY_STRING = 'CHANGE_QUERY_STRING'; export const GENERATE_LZ_STRING = 'GENERATE_LZ_STRING'; diff --git a/src/features/remoteExecution/RemoteExecutionActions.ts b/src/features/remoteExecution/RemoteExecutionActions.ts index 400a9c4b5a..28e7358fa3 100644 --- a/src/features/remoteExecution/RemoteExecutionActions.ts +++ b/src/features/remoteExecution/RemoteExecutionActions.ts @@ -1,6 +1,6 @@ +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import { action } from 'typesafe-actions'; -import { WorkspaceLocation } from '../../commons/workspace/WorkspaceTypes'; import { Device, DeviceSession, diff --git a/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx b/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx index a355d38e74..b4b8ed3a72 100644 --- a/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx +++ b/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx @@ -12,15 +12,15 @@ import classNames from 'classnames'; import React from 'react'; import { QrReader } from 'react-qr-reader'; import { useDispatch } from 'react-redux'; - -import { editDevice, registerDevice } from '../../commons/sagas/RequestsSaga'; -import { actions } from '../../commons/utils/ActionsHelper'; +import { editDevice, registerDevice } from 'src/commons/sagas/RequestsSaga'; +import { actions } from 'src/commons/utils/ActionsHelper'; import { checkFieldValidity, collectFieldValues, useField, validateNotEmpty -} from '../../commons/utils/FormHelper'; +} from 'src/commons/utils/FormHelper'; + import { Device, deviceTypes } from './RemoteExecutionTypes'; export interface RemoteExecutionDeviceDialogProps { diff --git a/src/features/sicp/TableOfContentsButton.tsx b/src/features/sicp/TableOfContentsButton.tsx index 70e0054e57..3af9165155 100644 --- a/src/features/sicp/TableOfContentsButton.tsx +++ b/src/features/sicp/TableOfContentsButton.tsx @@ -1,6 +1,5 @@ import React from 'react'; - -import ControlButton from '../../commons/ControlButton'; +import ControlButton from 'src/commons/ControlButton'; type TableOfContentsButtonProps = { handleOpenToc: () => void; diff --git a/src/features/sicp/parser/ParseJson.tsx b/src/features/sicp/parser/ParseJson.tsx index 9bfcf88c55..929925922a 100644 --- a/src/features/sicp/parser/ParseJson.tsx +++ b/src/features/sicp/parser/ParseJson.tsx @@ -3,11 +3,10 @@ import { IconNames } from '@blueprintjs/icons'; import React from 'react'; import { Link } from 'react-router-dom'; import Constants from 'src/commons/utils/Constants'; +import CodeSnippet from 'src/pages/sicp/subcomponents/CodeSnippet'; import SicpExercise from 'src/pages/sicp/subcomponents/SicpExercise'; import SicpLatex from 'src/pages/sicp/subcomponents/SicpLatex'; -import CodeSnippet from '../../../pages/sicp/subcomponents/CodeSnippet'; - // Custom error class for errors when parsing JSON files. export class ParseJsonError extends Error {} diff --git a/src/features/sourceRecorder/SourceRecorderActions.ts b/src/features/sourceRecorder/SourceRecorderActions.ts index c05ff21aa6..05815d3b58 100644 --- a/src/features/sourceRecorder/SourceRecorderActions.ts +++ b/src/features/sourceRecorder/SourceRecorderActions.ts @@ -1,6 +1,6 @@ +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import { action } from 'typesafe-actions'; -import { WorkspaceLocation } from '../../commons/workspace/WorkspaceTypes'; import { CodeDelta, Input, diff --git a/src/features/sourceRecorder/SourceRecorderTypes.ts b/src/features/sourceRecorder/SourceRecorderTypes.ts index ef504095fc..5d9b4307da 100644 --- a/src/features/sourceRecorder/SourceRecorderTypes.ts +++ b/src/features/sourceRecorder/SourceRecorderTypes.ts @@ -1,9 +1,8 @@ import { Ace } from 'ace-builds/ace'; import { Chapter } from 'js-slang/dist/types'; - -import { ExternalLibraryName } from '../../commons/application/types/ExternalTypes'; -import { Position } from '../../commons/editor/EditorTypes'; -import { SideContentType } from '../../commons/sideContent/SideContentTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { Position } from 'src/commons/editor/EditorTypes'; +import { SideContentType } from 'src/commons/sideContent/SideContentTypes'; export const SAVE_SOURCECAST_DATA = 'SAVE_SOURCECAST_DATA'; export const SET_CURRENT_PLAYER_TIME = 'SET_CURRENT_PLAYER_TIME'; diff --git a/src/features/sourceRecorder/sourcecast/SourcecastActions.ts b/src/features/sourceRecorder/sourcecast/SourcecastActions.ts index 59d5b6acdd..a94ee590f0 100644 --- a/src/features/sourceRecorder/sourcecast/SourcecastActions.ts +++ b/src/features/sourceRecorder/sourcecast/SourcecastActions.ts @@ -1,7 +1,7 @@ +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { SourcecastData } from 'src/features/sourceRecorder/SourceRecorderTypes'; import { action } from 'typesafe-actions'; -import { WorkspaceLocation } from '../../../commons/workspace/WorkspaceTypes'; -import { SourcecastData } from '../SourceRecorderTypes'; import { FETCH_SOURCECAST_INDEX, UPDATE_SOURCECAST_INDEX } from './SourcecastTypes'; export const fetchSourcecastIndex = (workspaceLocation: WorkspaceLocation) => diff --git a/src/features/sourceRecorder/sourcecast/SourcecastReducer.ts b/src/features/sourceRecorder/sourcecast/SourcecastReducer.ts index dc517596f9..82bd95abcd 100644 --- a/src/features/sourceRecorder/sourcecast/SourcecastReducer.ts +++ b/src/features/sourceRecorder/sourcecast/SourcecastReducer.ts @@ -1,4 +1,4 @@ -import { SourceActionType } from '../../../commons/utils/ActionsHelper'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; import { SAVE_SOURCECAST_DATA, SET_CODE_DELTAS_TO_APPLY, @@ -7,7 +7,8 @@ import { SET_SOURCECAST_DATA, SET_SOURCECAST_PLAYBACK_DURATION, SET_SOURCECAST_PLAYBACK_STATUS -} from '../SourceRecorderTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; + import { SourcecastWorkspaceState, UPDATE_SOURCECAST_INDEX } from './SourcecastTypes'; export const SourcecastReducer = ( diff --git a/src/features/sourceRecorder/sourcecast/SourcecastTypes.ts b/src/features/sourceRecorder/sourcecast/SourcecastTypes.ts index ffdc308142..f6df2b629c 100644 --- a/src/features/sourceRecorder/sourcecast/SourcecastTypes.ts +++ b/src/features/sourceRecorder/sourcecast/SourcecastTypes.ts @@ -1,11 +1,11 @@ -import { WorkspaceState } from '../../../commons/workspace/WorkspaceTypes'; +import { WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; import { CodeDelta, Input, PlaybackData, PlaybackStatus, SourcecastData -} from '../SourceRecorderTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; export const FETCH_SOURCECAST_INDEX = 'FETCH_SOURCECAST_INDEX'; export const SET_IS_EDITOR_READONLY = 'SET_IS_EDITOR_READONLY'; diff --git a/src/features/sourceRecorder/sourcereel/SourcereelActions.ts b/src/features/sourceRecorder/sourcereel/SourcereelActions.ts index 64c84043f1..dabac15d1e 100644 --- a/src/features/sourceRecorder/sourcereel/SourcereelActions.ts +++ b/src/features/sourceRecorder/sourcereel/SourcereelActions.ts @@ -1,7 +1,7 @@ +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { Input, PlaybackData } from 'src/features/sourceRecorder/SourceRecorderTypes'; import { action } from 'typesafe-actions'; -import { WorkspaceLocation } from '../../../commons/workspace/WorkspaceTypes'; -import { Input, PlaybackData } from '../SourceRecorderTypes'; import { DELETE_SOURCECAST_ENTRY, RECORD_INIT, diff --git a/src/features/sourceRecorder/sourcereel/SourcereelReducer.ts b/src/features/sourceRecorder/sourcereel/SourcereelReducer.ts index 70aee8d91b..170edfcf9c 100644 --- a/src/features/sourceRecorder/sourcereel/SourcereelReducer.ts +++ b/src/features/sourceRecorder/sourcereel/SourcereelReducer.ts @@ -1,5 +1,6 @@ -import { SourceActionType } from '../../../commons/utils/ActionsHelper'; -import { RecordingStatus } from '../SourceRecorderTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; +import { RecordingStatus } from 'src/features/sourceRecorder/SourceRecorderTypes'; + import { RECORD_INIT, RECORD_INPUT, diff --git a/src/features/sourceRecorder/sourcereel/SourcereelTypes.ts b/src/features/sourceRecorder/sourcereel/SourcereelTypes.ts index 76f739922a..cdb84d4d1f 100644 --- a/src/features/sourceRecorder/sourcereel/SourcereelTypes.ts +++ b/src/features/sourceRecorder/sourcereel/SourcereelTypes.ts @@ -1,5 +1,5 @@ -import { WorkspaceState } from '../../../commons/workspace/WorkspaceTypes'; -import { PlaybackData, RecordingStatus } from '../SourceRecorderTypes'; +import { WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; +import { PlaybackData, RecordingStatus } from 'src/features/sourceRecorder/SourceRecorderTypes'; export const DELETE_SOURCECAST_ENTRY = 'DELETE_SOURCECAST_ENTRY'; export const RECORD_INIT = 'RECORD_INIT'; diff --git a/src/features/stories/StoriesReducer.ts b/src/features/stories/StoriesReducer.ts index 5213fce320..8a0aabf687 100644 --- a/src/features/stories/StoriesReducer.ts +++ b/src/features/stories/StoriesReducer.ts @@ -1,15 +1,15 @@ import { stringify } from 'js-slang/dist/utils/stringify'; import { Reducer } from 'redux'; -import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; - import { createDefaultStoriesEnv, defaultStories, ErrorOutput, InterpreterOutput, ResultOutput -} from '../../commons/application/ApplicationTypes'; -import { SourceActionType } from '../../commons/utils/ActionsHelper'; +} from 'src/commons/application/ApplicationTypes'; +import { LOG_OUT } from 'src/commons/application/types/CommonsTypes'; +import { SourceActionType } from 'src/commons/utils/ActionsHelper'; + import { DEFAULT_ENV } from './storiesComponents/UserBlogContent'; import { ADD_STORY_ENV, diff --git a/src/features/stories/StoriesTypes.ts b/src/features/stories/StoriesTypes.ts index ee184e33f7..e97c5332d2 100644 --- a/src/features/stories/StoriesTypes.ts +++ b/src/features/stories/StoriesTypes.ts @@ -1,8 +1,7 @@ import { Context } from 'js-slang'; +import { InterpreterOutput, StoriesRole } from 'src/commons/application/ApplicationTypes'; import { DebuggerContext } from 'src/commons/workspace/WorkspaceTypes'; -import { InterpreterOutput, StoriesRole } from '../../commons/application/ApplicationTypes'; - export const ADD_STORY_ENV = 'ADD_STORY_ENV'; export const CLEAR_STORY_ENV = 'CLEAR_STORY_ENV'; export const EVAL_STORY = 'EVAL_STORY'; diff --git a/src/features/stories/storiesComponents/BackendAccess.ts b/src/features/stories/storiesComponents/BackendAccess.ts index f996240be4..02bee3ac50 100644 --- a/src/features/stories/storiesComponents/BackendAccess.ts +++ b/src/features/stories/storiesComponents/BackendAccess.ts @@ -1,4 +1,5 @@ import { StoriesRole } from 'src/commons/application/ApplicationTypes'; +import { Tokens } from 'src/commons/application/types/SessionTypes'; import { courseIdWithoutPrefix } from 'src/commons/sagas/RequestsSaga'; import Constants from 'src/commons/utils/Constants'; import { @@ -7,12 +8,10 @@ import { } from 'src/commons/utils/notifications/NotificationsHelper'; import { request } from 'src/commons/utils/RequestHelper'; import { RemoveLast } from 'src/commons/utils/TypeHelper'; +import { StoryListView, StoryView } from 'src/features/stories/StoriesTypes'; +import { NameUsernameRole } from 'src/pages/academy/adminPanel/subcomponents/AddStoriesUserPanel'; import { store } from 'src/pages/createStore'; -import { Tokens } from '../../../commons/application/types/SessionTypes'; -import { NameUsernameRole } from '../../../pages/academy/adminPanel/subcomponents/AddStoriesUserPanel'; -import { StoryListView, StoryView } from '../StoriesTypes'; - // Helpers type StoryRequestHelperParams = RemoveLast>; diff --git a/src/features/stories/storiesComponents/SourceBlock.tsx b/src/features/stories/storiesComponents/SourceBlock.tsx index b1333b80a1..9d077be7b1 100644 --- a/src/features/stories/storiesComponents/SourceBlock.tsx +++ b/src/features/stories/storiesComponents/SourceBlock.tsx @@ -5,9 +5,12 @@ import React, { useEffect, useRef, useState } from 'react'; import AceEditor from 'react-ace'; import { useDispatch } from 'react-redux'; import { ResultOutput, styliseSublanguage } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { ControlBarRunButton } from 'src/commons/controlBar/ControlBarRunButton'; import ControlButton from 'src/commons/ControlButton'; +import { Output } from 'src/commons/repl/Repl'; import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { getModeString, selectMode } from 'src/commons/utils/AceHelper'; import Constants from 'src/commons/utils/Constants'; import { useTypedSelector } from 'src/commons/utils/Hooks'; import { addHtmlConsoleError } from 'src/commons/workspace/WorkspaceActions'; @@ -22,9 +25,6 @@ import { makeSubstVisualizerTabFrom } from 'src/pages/playground/PlaygroundTabs'; -import { ExternalLibraryName } from '../../../commons/application/types/ExternalTypes'; -import { Output } from '../../../commons/repl/Repl'; -import { getModeString, selectMode } from '../../../commons/utils/AceHelper'; import StoriesSideContent, { StoriesSideContentProps } from './StoriesSideContent'; import { DEFAULT_ENV } from './UserBlogContent'; diff --git a/src/features/stories/storiesComponents/StoriesSideContent.tsx b/src/features/stories/storiesComponents/StoriesSideContent.tsx index c7784c9f10..14c3e1583a 100644 --- a/src/features/stories/storiesComponents/StoriesSideContent.tsx +++ b/src/features/stories/storiesComponents/StoriesSideContent.tsx @@ -1,15 +1,14 @@ import { Card, Icon, Tab, TabProps, Tabs } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; import * as React from 'react'; - import GenericSideContent, { generateIconId, GenericSideContentProps -} from '../../../commons/sideContent/GenericSideContent'; -import { SideContentTab, SideContentType } from '../../../commons/sideContent/SideContentTypes'; -import { propsAreEqual } from '../../../commons/utils/MemoizeHelper'; -import { assertType } from '../../../commons/utils/TypeHelper'; -import { WorkspaceLocation } from '../../../commons/workspace/WorkspaceTypes'; +} from 'src/commons/sideContent/GenericSideContent'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { propsAreEqual } from 'src/commons/utils/MemoizeHelper'; +import { assertType } from 'src/commons/utils/TypeHelper'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; export type StoriesSideContentProps = Omit & StateProps; diff --git a/src/features/stories/storiesComponents/UserBlogContent.tsx b/src/features/stories/storiesComponents/UserBlogContent.tsx index 7a1ff5bef9..03da8be557 100644 --- a/src/features/stories/storiesComponents/UserBlogContent.tsx +++ b/src/features/stories/storiesComponents/UserBlogContent.tsx @@ -6,8 +6,7 @@ import Constants from 'src/commons/utils/Constants'; import { propsAreEqual } from 'src/commons/utils/MemoizeHelper'; import { renderStoryMarkdown } from 'src/commons/utils/StoriesHelper'; import { addStoryEnv, clearStoryEnv } from 'src/features/stories/StoriesActions'; - -import { store } from '../../../pages/createStore'; +import { store } from 'src/pages/createStore'; type UserBlogProps = { fileContent: string; diff --git a/src/features/storySimulator/StorySimulatorRequest.ts b/src/features/storySimulator/StorySimulatorRequest.ts index 36a0a3fd17..f1cc0356df 100644 --- a/src/features/storySimulator/StorySimulatorRequest.ts +++ b/src/features/storySimulator/StorySimulatorRequest.ts @@ -1,6 +1,6 @@ -import Constants from '../../commons/utils/Constants'; -import SourceAcademyGame from '../game/SourceAcademyGame'; -import { courseId } from '../game/utils/GameUtils'; +import Constants from 'src/commons/utils/Constants'; +import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; +import { courseId } from 'src/features/game/utils/GameUtils'; const sendRequest = (route: string) => diff --git a/src/features/storySimulator/background/SSBackgroundManager.ts b/src/features/storySimulator/background/SSBackgroundManager.ts index d977d6bd49..7fb9baeb8b 100644 --- a/src/features/storySimulator/background/SSBackgroundManager.ts +++ b/src/features/storySimulator/background/SSBackgroundManager.ts @@ -2,9 +2,8 @@ import { screenCenter } from 'src/features/game/commons/CommonConstants'; import { AssetKey } from 'src/features/game/commons/CommonTypes'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; - -import { loadImage } from '../../game/utils/LoaderUtils'; -import ObjectPlacement from '../scenes/ObjectPlacement/ObjectPlacement'; +import { loadImage } from 'src/features/game/utils/LoaderUtils'; +import ObjectPlacement from 'src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement'; /** * This manager manages the background for Story Simulator's Object Placement scene diff --git a/src/features/storySimulator/boundingBoxes/SSBBoxManager.ts b/src/features/storySimulator/boundingBoxes/SSBBoxManager.ts index fe14608aa5..e3fd5f36ce 100644 --- a/src/features/storySimulator/boundingBoxes/SSBBoxManager.ts +++ b/src/features/storySimulator/boundingBoxes/SSBBoxManager.ts @@ -4,10 +4,10 @@ import { mandatory } from 'src/features/game/utils/GameUtils'; import { resize } from 'src/features/game/utils/SpriteUtils'; import StringUtils from 'src/features/game/utils/StringUtils'; import { HexColor } from 'src/features/game/utils/StyleUtils'; +import { CursorMode } from 'src/features/storySimulator/cursorMode/SSCursorModeTypes'; +import { ICheckpointLoggable } from 'src/features/storySimulator/logger/SSLogManagerTypes'; +import ObjectPlacement from 'src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement'; -import { CursorMode } from '../cursorMode/SSCursorModeTypes'; -import { ICheckpointLoggable } from '../logger/SSLogManagerTypes'; -import ObjectPlacement from '../scenes/ObjectPlacement/ObjectPlacement'; import { SSBBoxDetail } from './SSBBoxManagerTypes'; /** diff --git a/src/features/storySimulator/cursorMode/SSCursorMode.ts b/src/features/storySimulator/cursorMode/SSCursorMode.ts index b2957981f4..0161e93a82 100644 --- a/src/features/storySimulator/cursorMode/SSCursorMode.ts +++ b/src/features/storySimulator/cursorMode/SSCursorMode.ts @@ -2,8 +2,8 @@ import { Constants } from 'src/features/game/commons/CommonConstants'; import CommonTextHover from 'src/features/game/commons/CommonTextHover'; import { AssetKey } from 'src/features/game/commons/CommonTypes'; import { createButton } from 'src/features/game/utils/ButtonUtils'; +import SSImageAssets from 'src/features/storySimulator/assets/ImageAssets'; -import SSImageAssets from '../assets/ImageAssets'; import SSCursorModeConstants from './SSCursorModeConstants'; import { CursorMode } from './SSCursorModeTypes'; diff --git a/src/features/storySimulator/logger/SSLogManager.ts b/src/features/storySimulator/logger/SSLogManager.ts index 4ecda037bb..1797422004 100644 --- a/src/features/storySimulator/logger/SSLogManager.ts +++ b/src/features/storySimulator/logger/SSLogManager.ts @@ -3,8 +3,8 @@ import { mandatory } from 'src/features/game/utils/GameUtils'; import StringUtils from 'src/features/game/utils/StringUtils'; import { HexColor } from 'src/features/game/utils/StyleUtils'; import { createBitmapText } from 'src/features/game/utils/TextUtils'; +import ObjectPlacement from 'src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement'; -import ObjectPlacement from '../scenes/ObjectPlacement/ObjectPlacement'; import { loggableStyle } from './SSLogConstants'; import { getIdFromShortPath, padWithTab } from './SSLogManagerHelper'; import { ICheckpointLoggable, IScreenLoggable } from './SSLogManagerTypes'; diff --git a/src/features/storySimulator/objects/SSObjectManager.ts b/src/features/storySimulator/objects/SSObjectManager.ts index c279b8b288..e48f864e7d 100644 --- a/src/features/storySimulator/objects/SSObjectManager.ts +++ b/src/features/storySimulator/objects/SSObjectManager.ts @@ -2,12 +2,12 @@ import { screenCenter } from 'src/features/game/commons/CommonConstants'; import { AssetKey, ItemId } from 'src/features/game/commons/CommonTypes'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; +import { loadImage } from 'src/features/game/utils/LoaderUtils'; import StringUtils from 'src/features/game/utils/StringUtils'; +import { getIdFromShortPath } from 'src/features/storySimulator/logger/SSLogManagerHelper'; +import { ICheckpointLoggable } from 'src/features/storySimulator/logger/SSLogManagerTypes'; +import ObjectPlacement from 'src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement'; -import { loadImage } from '../../game/utils/LoaderUtils'; -import { getIdFromShortPath } from '../logger/SSLogManagerHelper'; -import { ICheckpointLoggable } from '../logger/SSLogManagerTypes'; -import ObjectPlacement from '../scenes/ObjectPlacement/ObjectPlacement'; import { SSObjectDetail } from './SSObjectManagerTypes'; /** diff --git a/src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement.ts b/src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement.ts index 7e92ea860c..567c301769 100644 --- a/src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement.ts +++ b/src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement.ts @@ -6,16 +6,16 @@ import GameLayerManager from 'src/features/game/layer/GameLayerManager'; import { Layer } from 'src/features/game/layer/GameLayerTypes'; import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; import { mandatory } from 'src/features/game/utils/GameUtils'; +import SSImageAssets from 'src/features/storySimulator/assets/ImageAssets'; +import SSBackgroundManager from 'src/features/storySimulator/background/SSBackgroundManager'; +import SSBBoxManager from 'src/features/storySimulator/boundingBoxes/SSBBoxManager'; +import SSCursorMode from 'src/features/storySimulator/cursorMode/SSCursorMode'; +import { CursorMode } from 'src/features/storySimulator/cursorMode/SSCursorModeTypes'; +import SSLogManager from 'src/features/storySimulator/logger/SSLogManager'; +import SSObjectManager from 'src/features/storySimulator/objects/SSObjectManager'; +import { StorySimState } from 'src/features/storySimulator/StorySimulatorTypes'; +import SSTransformManager from 'src/features/storySimulator/transform/SSTransformManager'; -import SSImageAssets from '../../assets/ImageAssets'; -import SSBackgroundManager from '../../background/SSBackgroundManager'; -import SSBBoxManager from '../../boundingBoxes/SSBBoxManager'; -import SSCursorMode from '../../cursorMode/SSCursorMode'; -import { CursorMode } from '../../cursorMode/SSCursorModeTypes'; -import SSLogManager from '../../logger/SSLogManager'; -import SSObjectManager from '../../objects/SSObjectManager'; -import { StorySimState } from '../../StorySimulatorTypes'; -import SSTransformManager from '../../transform/SSTransformManager'; import ObjPlacementConstants from './ObjectPlacementConstants'; /** diff --git a/src/features/storySimulator/scenes/mainMenu/MainMenu.ts b/src/features/storySimulator/scenes/mainMenu/MainMenu.ts index 6f4996975b..d4fb9ff1fe 100644 --- a/src/features/storySimulator/scenes/mainMenu/MainMenu.ts +++ b/src/features/storySimulator/scenes/mainMenu/MainMenu.ts @@ -10,9 +10,9 @@ import SourceAcademyGame from 'src/features/game/SourceAcademyGame'; import { createButton } from 'src/features/game/utils/ButtonUtils'; import { mandatory, toS3Path } from 'src/features/game/utils/GameUtils'; import { calcTableFormatPos } from 'src/features/game/utils/StyleUtils'; +import SSImageAssets from 'src/features/storySimulator/assets/ImageAssets'; +import { StorySimState } from 'src/features/storySimulator/StorySimulatorTypes'; -import SSImageAssets from '../../assets/ImageAssets'; -import { StorySimState } from '../../StorySimulatorTypes'; import mainMenuConstants, { mainMenuOptStyle } from './MainMenuConstants'; /** diff --git a/src/features/storySimulator/transform/SSTransformManager.ts b/src/features/storySimulator/transform/SSTransformManager.ts index 97b63b0f37..493caa23ab 100644 --- a/src/features/storySimulator/transform/SSTransformManager.ts +++ b/src/features/storySimulator/transform/SSTransformManager.ts @@ -1,9 +1,9 @@ import { Layer } from 'src/features/game/layer/GameLayerTypes'; import { mandatory } from 'src/features/game/utils/GameUtils'; import { multiplyDimensions } from 'src/features/game/utils/SpriteUtils'; +import { CursorMode } from 'src/features/storySimulator/cursorMode/SSCursorModeTypes'; +import ObjectPlacement from 'src/features/storySimulator/scenes/ObjectPlacement/ObjectPlacement'; -import { CursorMode } from '../cursorMode/SSCursorModeTypes'; -import ObjectPlacement from '../scenes/ObjectPlacement/ObjectPlacement'; import TransformConstants from './SSTransformManagerConstants'; /** diff --git a/src/pages/academy/Academy.tsx b/src/pages/academy/Academy.tsx index 42a3b9e7bc..d24740e929 100644 --- a/src/pages/academy/Academy.tsx +++ b/src/pages/academy/Academy.tsx @@ -3,21 +3,21 @@ import classNames from 'classnames'; import * as React from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, Route, Routes, useNavigate, useParams } from 'react-router'; +import { + fetchNotifications, + updateLatestViewedCourse +} from 'src/commons/application/actions/SessionActions'; import { Role } from 'src/commons/application/ApplicationTypes'; +import Assessment from 'src/commons/assessment/Assessment'; import ResearchAgreementPrompt from 'src/commons/researchAgreementPrompt/ResearchAgreementPrompt'; import Constants from 'src/commons/utils/Constants'; import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; +import { assessmentRegExp, gradingRegExp, numberRegExp } from 'src/features/academy/AcademyTypes'; +import Achievement from 'src/pages/achievement/Achievement'; +import NotFound from 'src/pages/notFound/NotFound'; +import Sourcecast from 'src/pages/sourcecast/Sourcecast'; -import { - fetchNotifications, - updateLatestViewedCourse -} from '../../commons/application/actions/SessionActions'; -import Assessment from '../../commons/assessment/Assessment'; -import { assessmentTypeLink } from '../../commons/utils/ParamParseHelper'; -import { assessmentRegExp, gradingRegExp, numberRegExp } from '../../features/academy/AcademyTypes'; -import Achievement from '../achievement/Achievement'; -import NotFound from '../notFound/NotFound'; -import Sourcecast from '../sourcecast/Sourcecast'; import AdminPanel from './adminPanel/AdminPanel'; import Dashboard from './dashboard/Dashboard'; import Game from './game/Game'; diff --git a/src/pages/academy/adminPanel/AdminPanel.tsx b/src/pages/academy/adminPanel/AdminPanel.tsx index 470e07c9be..621ec99391 100644 --- a/src/pages/academy/adminPanel/AdminPanel.tsx +++ b/src/pages/academy/adminPanel/AdminPanel.tsx @@ -5,13 +5,6 @@ import { Button, Divider, H1, Intent, Tab, Tabs } from '@blueprintjs/core'; import { cloneDeep } from 'lodash'; import React from 'react'; import { useDispatch } from 'react-redux'; -import { Role } from 'src/commons/application/ApplicationTypes'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; -import { - addNewStoriesUsersToCourse, - addNewUsersToCourse -} from 'src/features/academy/AcademyActions'; - import { deleteAssessmentConfig, deleteUserCourseRegistration, @@ -23,10 +16,17 @@ import { updateAssessmentConfigs, updateCourseConfig, updateUserRole -} from '../../../commons/application/actions/SessionActions'; -import { UpdateCourseConfiguration } from '../../../commons/application/types/SessionTypes'; -import { AssessmentConfiguration } from '../../../commons/assessment/AssessmentTypes'; -import ContentDisplay from '../../../commons/ContentDisplay'; +} from 'src/commons/application/actions/SessionActions'; +import { Role } from 'src/commons/application/ApplicationTypes'; +import { UpdateCourseConfiguration } from 'src/commons/application/types/SessionTypes'; +import { AssessmentConfiguration } from 'src/commons/assessment/AssessmentTypes'; +import ContentDisplay from 'src/commons/ContentDisplay'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { + addNewStoriesUsersToCourse, + addNewUsersToCourse +} from 'src/features/academy/AcademyActions'; + import AddStoriesUserPanel, { NameUsernameRole } from './subcomponents/AddStoriesUserPanel'; import AddUserPanel, { UsernameRoleGroup } from './subcomponents/AddUserPanel'; import AssessmentConfigPanel from './subcomponents/assessmentConfigPanel/AssessmentConfigPanel'; diff --git a/src/pages/academy/adminPanel/subcomponents/AddStoriesUserPanel.tsx b/src/pages/academy/adminPanel/subcomponents/AddStoriesUserPanel.tsx index 569e132a2b..b7bbc4dbc6 100644 --- a/src/pages/academy/adminPanel/subcomponents/AddStoriesUserPanel.tsx +++ b/src/pages/academy/adminPanel/subcomponents/AddStoriesUserPanel.tsx @@ -18,8 +18,7 @@ import { uniqBy } from 'lodash'; import React from 'react'; import { useCSVReader } from 'react-papaparse'; import { StoriesRole } from 'src/commons/application/ApplicationTypes'; - -import Constants from '../../../../commons/utils/Constants'; +import Constants from 'src/commons/utils/Constants'; type Props = { handleAddNewUsersToCourse: (users: NameUsernameRole[], provider: string) => void; diff --git a/src/pages/academy/adminPanel/subcomponents/AddUserPanel.tsx b/src/pages/academy/adminPanel/subcomponents/AddUserPanel.tsx index 80ed57f3c5..1678a94de4 100644 --- a/src/pages/academy/adminPanel/subcomponents/AddUserPanel.tsx +++ b/src/pages/academy/adminPanel/subcomponents/AddUserPanel.tsx @@ -18,8 +18,7 @@ import { uniqBy } from 'lodash'; import React from 'react'; import { useCSVReader } from 'react-papaparse'; import { Role } from 'src/commons/application/ApplicationTypes'; - -import Constants from '../../../../commons/utils/Constants'; +import Constants from 'src/commons/utils/Constants'; type Props = { handleAddNewUsersToCourse: (users: UsernameRoleGroup[], provider: string) => void; diff --git a/src/pages/academy/adminPanel/subcomponents/CourseConfigPanel.tsx b/src/pages/academy/adminPanel/subcomponents/CourseConfigPanel.tsx index 621c5ebe83..97474082e0 100644 --- a/src/pages/academy/adminPanel/subcomponents/CourseConfigPanel.tsx +++ b/src/pages/academy/adminPanel/subcomponents/CourseConfigPanel.tsx @@ -10,11 +10,10 @@ import { TextArea } from '@blueprintjs/core'; import * as React from 'react'; +import { UpdateCourseConfiguration } from 'src/commons/application/types/SessionTypes'; +import Markdown from 'src/commons/Markdown'; import { useResponsive } from 'src/commons/utils/Hooks'; -import { UpdateCourseConfiguration } from '../../../../commons/application/types/SessionTypes'; -import Markdown from '../../../../commons/Markdown'; - export type CourseConfigPanelProps = OwnProps; type OwnProps = { diff --git a/src/pages/academy/adminPanel/subcomponents/assessmentConfigPanel/AssessmentConfigPanel.tsx b/src/pages/academy/adminPanel/subcomponents/assessmentConfigPanel/AssessmentConfigPanel.tsx index f7ae3efde6..95f2bd139f 100644 --- a/src/pages/academy/adminPanel/subcomponents/assessmentConfigPanel/AssessmentConfigPanel.tsx +++ b/src/pages/academy/adminPanel/subcomponents/assessmentConfigPanel/AssessmentConfigPanel.tsx @@ -3,9 +3,9 @@ import { CellValueChangedEvent, GridApi, GridReadyEvent, RowDragEvent } from 'ag import { AgGridReact } from 'ag-grid-react'; import { isEqual } from 'lodash'; import React from 'react'; +import { AssessmentConfiguration } from 'src/commons/assessment/AssessmentTypes'; import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; -import { AssessmentConfiguration } from '../../../../../commons/assessment/AssessmentTypes'; import BooleanCell from './BooleanCell'; import DeleteRowCell from './DeleteRowCell'; import NumericCell from './NumericCell'; diff --git a/src/pages/academy/dashboard/Dashboard.tsx b/src/pages/academy/dashboard/Dashboard.tsx index 4b6fbb81b0..2e72d05b8a 100644 --- a/src/pages/academy/dashboard/Dashboard.tsx +++ b/src/pages/academy/dashboard/Dashboard.tsx @@ -6,10 +6,9 @@ import { AgGridReact } from 'ag-grid-react'; import { startCase } from 'lodash'; import * as React from 'react'; import { useDispatch } from 'react-redux'; +import ContentDisplay from 'src/commons/ContentDisplay'; import { useTypedSelector } from 'src/commons/utils/Hooks'; - -import ContentDisplay from '../../../commons/ContentDisplay'; -import { fetchGroupGradingSummary } from '../../../features/dashboard/DashboardActions'; +import { fetchGroupGradingSummary } from 'src/features/dashboard/DashboardActions'; type DashboardProps = StateProps; diff --git a/src/pages/academy/grading/Grading.tsx b/src/pages/academy/grading/Grading.tsx index 0fec1a1d8e..24adccb9fc 100644 --- a/src/pages/academy/grading/Grading.tsx +++ b/src/pages/academy/grading/Grading.tsx @@ -8,13 +8,13 @@ import { useDispatch } from 'react-redux'; import { Navigate, useParams } from 'react-router'; import { fetchGradingOverviews } from 'src/commons/application/actions/SessionActions'; import { Role } from 'src/commons/application/ApplicationTypes'; +import ContentDisplay from 'src/commons/ContentDisplay'; import SimpleDropdown from 'src/commons/SimpleDropdown'; import { useSession } from 'src/commons/utils/Hooks'; +import { convertParamToInt } from 'src/commons/utils/ParamParseHelper'; import { numberRegExp } from 'src/features/academy/AcademyTypes'; import { exportGradingCSV, isSubmissionUngraded } from 'src/features/grading/GradingUtils'; -import ContentDisplay from '../../../commons/ContentDisplay'; -import { convertParamToInt } from '../../../commons/utils/ParamParseHelper'; import GradingSubmissionsTable from './subcomponents/GradingSubmissionsTable'; import GradingSummary from './subcomponents/GradingSummary'; import GradingWorkspace from './subcomponents/GradingWorkspace'; diff --git a/src/pages/academy/grading/subcomponents/GradingEditor.tsx b/src/pages/academy/grading/subcomponents/GradingEditor.tsx index 54ac9edb7d..2c62b2e17d 100644 --- a/src/pages/academy/grading/subcomponents/GradingEditor.tsx +++ b/src/pages/academy/grading/subcomponents/GradingEditor.tsx @@ -12,17 +12,16 @@ import { import { IconNames } from '@blueprintjs/icons'; import React, { useEffect, useState } from 'react'; import ReactMde, { ReactMdeProps } from 'react-mde'; - -import ControlButton from '../../../../commons/ControlButton'; -import Markdown from '../../../../commons/Markdown'; -import { Prompt } from '../../../../commons/ReactRouterPrompt'; -import { getPrettyDate } from '../../../../commons/utils/DateHelper'; -import { showSimpleConfirmDialog } from '../../../../commons/utils/DialogHelper'; +import ControlButton from 'src/commons/ControlButton'; +import Markdown from 'src/commons/Markdown'; +import { Prompt } from 'src/commons/ReactRouterPrompt'; +import { getPrettyDate } from 'src/commons/utils/DateHelper'; +import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; import { showSuccessMessage, showWarningMessage -} from '../../../../commons/utils/notifications/NotificationsHelper'; -import { convertParamToInt } from '../../../../commons/utils/ParamParseHelper'; +} from 'src/commons/utils/notifications/NotificationsHelper'; +import { convertParamToInt } from 'src/commons/utils/ParamParseHelper'; type GradingEditorProps = DispatchProps & OwnProps; diff --git a/src/pages/academy/grading/subcomponents/GradingEditorContainer.ts b/src/pages/academy/grading/subcomponents/GradingEditorContainer.ts index 1a4b8d3e21..4d39a67022 100644 --- a/src/pages/academy/grading/subcomponents/GradingEditorContainer.ts +++ b/src/pages/academy/grading/subcomponents/GradingEditorContainer.ts @@ -1,11 +1,11 @@ import { connect, MapDispatchToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; - import { reautogradeAnswer, submitGrading, submitGradingAndContinue -} from '../../../../commons/application/actions/SessionActions'; +} from 'src/commons/application/actions/SessionActions'; + import GradingEditor, { DispatchProps } from './GradingEditor'; const mapDispatchToProps: MapDispatchToProps = (dispatch: Dispatch) => diff --git a/src/pages/academy/grading/subcomponents/GradingWorkspace.tsx b/src/pages/academy/grading/subcomponents/GradingWorkspace.tsx index 8c15ef3c1d..7abee7f172 100644 --- a/src/pages/academy/grading/subcomponents/GradingWorkspace.tsx +++ b/src/pages/academy/grading/subcomponents/GradingWorkspace.tsx @@ -6,9 +6,32 @@ import React, { useEffect, useMemo, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router'; import { fetchGrading } from 'src/commons/application/actions/SessionActions'; +import { defaultWorkspaceManager } from 'src/commons/application/ApplicationTypes'; +import { + AutogradingResult, + IMCQQuestion, + Library, + Question, + QuestionTypes, + Testcase +} from 'src/commons/assessment/AssessmentTypes'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { ControlBarNextButton } from 'src/commons/controlBar/ControlBarNextButton'; +import { ControlBarPreviousButton } from 'src/commons/controlBar/ControlBarPreviousButton'; +import { ControlBarQuestionViewButton } from 'src/commons/controlBar/ControlBarQuestionViewButton'; +import { ControlBarRunButton } from 'src/commons/controlBar/ControlBarRunButton'; +import { convertEditorTabStateToProps } from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import Markdown from 'src/commons/Markdown'; +import { SideContentProps } from 'src/commons/sideContent/SideContent'; +import SideContentAutograder from 'src/commons/sideContent/SideContentAutograder'; import SideContentToneMatrix from 'src/commons/sideContent/SideContentToneMatrix'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; import { showSimpleErrorDialog } from 'src/commons/utils/DialogHelper'; import { useTypedSelector } from 'src/commons/utils/Hooks'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { beginClearContext, browseReplHistoryDown, @@ -31,32 +54,9 @@ import { updateHasUnsavedChanges, updateReplValue } from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation, WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; +import { AnsweredQuestion } from 'src/features/grading/GradingTypes'; -import { defaultWorkspaceManager } from '../../../../commons/application/ApplicationTypes'; -import { - AutogradingResult, - IMCQQuestion, - Library, - Question, - QuestionTypes, - Testcase -} from '../../../../commons/assessment/AssessmentTypes'; -import { ControlBarProps } from '../../../../commons/controlBar/ControlBar'; -import { ControlBarClearButton } from '../../../../commons/controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../../../../commons/controlBar/ControlBarEvalButton'; -import { ControlBarNextButton } from '../../../../commons/controlBar/ControlBarNextButton'; -import { ControlBarPreviousButton } from '../../../../commons/controlBar/ControlBarPreviousButton'; -import { ControlBarQuestionViewButton } from '../../../../commons/controlBar/ControlBarQuestionViewButton'; -import { ControlBarRunButton } from '../../../../commons/controlBar/ControlBarRunButton'; -import { convertEditorTabStateToProps } from '../../../../commons/editor/EditorContainer'; -import { Position } from '../../../../commons/editor/EditorTypes'; -import Markdown from '../../../../commons/Markdown'; -import { SideContentProps } from '../../../../commons/sideContent/SideContent'; -import SideContentAutograder from '../../../../commons/sideContent/SideContentAutograder'; -import { SideContentTab, SideContentType } from '../../../../commons/sideContent/SideContentTypes'; -import Workspace, { WorkspaceProps } from '../../../../commons/workspace/Workspace'; -import { WorkspaceLocation, WorkspaceState } from '../../../../commons/workspace/WorkspaceTypes'; -import { AnsweredQuestion } from '../../../../features/grading/GradingTypes'; import GradingEditor from './GradingEditorContainer'; type GradingWorkspaceProps = { diff --git a/src/pages/academy/groundControl/GroundControl.tsx b/src/pages/academy/groundControl/GroundControl.tsx index 20b5f49a1e..868522a58e 100644 --- a/src/pages/academy/groundControl/GroundControl.tsx +++ b/src/pages/academy/groundControl/GroundControl.tsx @@ -6,12 +6,12 @@ import { IconNames } from '@blueprintjs/icons'; import { ColDef, ColumnApi, GridApi, GridReadyEvent } from 'ag-grid-community'; import { AgGridReact } from 'ag-grid-react'; import * as React from 'react'; - import { AssessmentConfiguration, AssessmentOverview -} from '../../../commons/assessment/AssessmentTypes'; -import ContentDisplay from '../../../commons/ContentDisplay'; +} from 'src/commons/assessment/AssessmentTypes'; +import ContentDisplay from 'src/commons/ContentDisplay'; + import DefaultChapterSelect from './subcomponents/DefaultChapterSelectContainer'; import DeleteCell from './subcomponents/GroundControlDeleteCell'; import Dropzone from './subcomponents/GroundControlDropzone'; diff --git a/src/pages/academy/groundControl/GroundControlContainer.ts b/src/pages/academy/groundControl/GroundControlContainer.ts index d050fca668..b4597b1751 100644 --- a/src/pages/academy/groundControl/GroundControlContainer.ts +++ b/src/pages/academy/groundControl/GroundControlContainer.ts @@ -1,17 +1,17 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; - import { fetchAssessmentOverviews, fetchCourseConfig -} from '../../../commons/application/actions/SessionActions'; -import { OverallState } from '../../../commons/application/ApplicationTypes'; +} from 'src/commons/application/actions/SessionActions'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; import { changeDateAssessment, deleteAssessment, publishAssessment, uploadAssessment -} from '../../../features/groundControl/GroundControlActions'; +} from 'src/features/groundControl/GroundControlActions'; + import GroundControl, { DispatchProps, StateProps } from './GroundControl'; const mapStateToProps: MapStateToProps = state => ({ diff --git a/src/pages/academy/groundControl/subcomponents/DefaultChapterSelect.tsx b/src/pages/academy/groundControl/subcomponents/DefaultChapterSelect.tsx index d7e876a0c1..c28d000a4b 100644 --- a/src/pages/academy/groundControl/subcomponents/DefaultChapterSelect.tsx +++ b/src/pages/academy/groundControl/subcomponents/DefaultChapterSelect.tsx @@ -3,13 +3,12 @@ import { IconNames } from '@blueprintjs/icons'; import { ItemListRenderer, ItemRenderer, Select } from '@blueprintjs/select'; import { Chapter, Variant } from 'js-slang/dist/types'; import * as React from 'react'; - import { SALanguage, sourceLanguages, styliseSublanguage -} from '../../../../commons/application/ApplicationTypes'; -import ControlButton from '../../../../commons/ControlButton'; +} from 'src/commons/application/ApplicationTypes'; +import ControlButton from 'src/commons/ControlButton'; export type DefaultChapterSelectProps = DispatchProps & StateProps; diff --git a/src/pages/academy/groundControl/subcomponents/DefaultChapterSelectContainer.ts b/src/pages/academy/groundControl/subcomponents/DefaultChapterSelectContainer.ts index d1b6116973..849b1df03c 100644 --- a/src/pages/academy/groundControl/subcomponents/DefaultChapterSelectContainer.ts +++ b/src/pages/academy/groundControl/subcomponents/DefaultChapterSelectContainer.ts @@ -1,9 +1,9 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; import Constants from 'src/commons/utils/Constants'; +import { changeSublanguage } from 'src/commons/workspace/WorkspaceActions'; -import { OverallState } from '../../../../commons/application/ApplicationTypes'; -import { changeSublanguage } from '../../../../commons/workspace/WorkspaceActions'; import DefaultChapterSelect, { DispatchProps, StateProps } from './DefaultChapterSelect'; const mapStateToProps: MapStateToProps = state => ({ diff --git a/src/pages/academy/groundControl/subcomponents/GroundControlDeleteCell.tsx b/src/pages/academy/groundControl/subcomponents/GroundControlDeleteCell.tsx index 3019603c2a..213c9ad0eb 100644 --- a/src/pages/academy/groundControl/subcomponents/GroundControlDeleteCell.tsx +++ b/src/pages/academy/groundControl/subcomponents/GroundControlDeleteCell.tsx @@ -1,9 +1,8 @@ import { Classes, Dialog, Intent } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - -import { AssessmentOverview } from '../../../../commons/assessment/AssessmentTypes'; -import ControlButton from '../../../../commons/ControlButton'; +import { AssessmentOverview } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; export type DeleteCellProps = DispatchProps & StateProps; diff --git a/src/pages/academy/groundControl/subcomponents/GroundControlDropzone.tsx b/src/pages/academy/groundControl/subcomponents/GroundControlDropzone.tsx index 95ed442d43..a1cfeb1219 100644 --- a/src/pages/academy/groundControl/subcomponents/GroundControlDropzone.tsx +++ b/src/pages/academy/groundControl/subcomponents/GroundControlDropzone.tsx @@ -4,9 +4,8 @@ import classNames from 'classnames'; import * as React from 'react'; import { FileRejection, useDropzone } from 'react-dropzone'; import { AssessmentConfiguration } from 'src/commons/assessment/AssessmentTypes'; - -import ControlButton from '../../../../commons/ControlButton'; -import { showWarningMessage } from '../../../../commons/utils/notifications/NotificationsHelper'; +import ControlButton from 'src/commons/ControlButton'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type DropzoneProps = DispatchProps & StateProps; diff --git a/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx b/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx index ba9c58083e..bd4173c1dc 100644 --- a/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx +++ b/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx @@ -3,10 +3,9 @@ import { DateInput } from '@blueprintjs/datetime'; import { IconNames } from '@blueprintjs/icons'; import * as moment from 'moment'; import * as React from 'react'; - -import { AssessmentOverview } from '../../../../commons/assessment/AssessmentTypes'; -import ControlButton from '../../../../commons/ControlButton'; -import { showWarningMessage } from '../../../../commons/utils/notifications/NotificationsHelper'; +import { AssessmentOverview } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; export type EditCellProps = DispatchProps & StateProps; diff --git a/src/pages/academy/groundControl/subcomponents/GroundControlPublishCell.tsx b/src/pages/academy/groundControl/subcomponents/GroundControlPublishCell.tsx index 29d2bedbcf..f6e1c37d0d 100644 --- a/src/pages/academy/groundControl/subcomponents/GroundControlPublishCell.tsx +++ b/src/pages/academy/groundControl/subcomponents/GroundControlPublishCell.tsx @@ -1,9 +1,8 @@ import { Classes, Dialog, Intent, Switch } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; - -import { AssessmentOverview } from '../../../../commons/assessment/AssessmentTypes'; -import ControlButton from '../../../../commons/ControlButton'; +import { AssessmentOverview } from 'src/commons/assessment/AssessmentTypes'; +import ControlButton from 'src/commons/ControlButton'; export type PublishCellProps = DispatchProps & StateProps; diff --git a/src/pages/academy/sourcereel/Sourcereel.tsx b/src/pages/academy/sourcereel/Sourcereel.tsx index 54d68d852c..ee60455a6f 100644 --- a/src/pages/academy/sourcereel/Sourcereel.tsx +++ b/src/pages/academy/sourcereel/Sourcereel.tsx @@ -10,47 +10,25 @@ import { debuggerReset, debuggerResume } from 'src/commons/application/actions/InterpreterActions'; -import { fetchSourcecastIndex } from 'src/features/sourceRecorder/sourcecast/SourcecastActions'; -import { - saveSourcecastData, - setCodeDeltasToApply, - setCurrentPlayerTime, - setInputToApply, - setSourcecastData, - setSourcecastDuration, - setSourcecastStatus -} from 'src/features/sourceRecorder/SourceRecorderActions'; -import { - deleteSourcecastEntry, - recordInit, - recordInput, - resetInputs, - timerPause, - timerReset, - timerResume, - timerStart, - timerStop -} from 'src/features/sourceRecorder/sourcereel/SourcereelActions'; - -import { ExternalLibraryName } from '../../../commons/application/types/ExternalTypes'; -import { ControlBarAutorunButtons } from '../../../commons/controlBar/ControlBarAutorunButtons'; -import { ControlBarChapterSelect } from '../../../commons/controlBar/ControlBarChapterSelect'; -import { ControlBarClearButton } from '../../../commons/controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../../../commons/controlBar/ControlBarEvalButton'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { ControlBarAutorunButtons } from 'src/commons/controlBar/ControlBarAutorunButtons'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; import { convertEditorTabStateToProps, SourcecastEditorContainerProps -} from '../../../commons/editor/EditorContainer'; -import { Position } from '../../../commons/editor/EditorTypes'; -import SideContentDataVisualizer from '../../../commons/sideContent/SideContentDataVisualizer'; -import SideContentEnvVisualizer from '../../../commons/sideContent/SideContentEnvVisualizer'; -import { SideContentTab, SideContentType } from '../../../commons/sideContent/SideContentTypes'; +} from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import SideContentDataVisualizer from 'src/commons/sideContent/SideContentDataVisualizer'; +import SideContentEnvVisualizer from 'src/commons/sideContent/SideContentEnvVisualizer'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; import SourceRecorderControlBar, { SourceRecorderControlBarProps -} from '../../../commons/sourceRecorder/SourceRecorderControlBar'; -import SourcecastTable from '../../../commons/sourceRecorder/SourceRecorderTable'; -import { useTypedSelector } from '../../../commons/utils/Hooks'; -import Workspace, { WorkspaceProps } from '../../../commons/workspace/Workspace'; +} from 'src/commons/sourceRecorder/SourceRecorderControlBar'; +import SourcecastTable from 'src/commons/sourceRecorder/SourceRecorderTable'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { browseReplHistoryDown, browseReplHistoryUp, @@ -69,8 +47,18 @@ import { updateActiveEditorTabIndex, updateEditorValue, updateReplValue -} from '../../../commons/workspace/WorkspaceActions'; -import { WorkspaceLocation } from '../../../commons/workspace/WorkspaceTypes'; +} from 'src/commons/workspace/WorkspaceActions'; +import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; +import { fetchSourcecastIndex } from 'src/features/sourceRecorder/sourcecast/SourcecastActions'; +import { + saveSourcecastData, + setCodeDeltasToApply, + setCurrentPlayerTime, + setInputToApply, + setSourcecastData, + setSourcecastDuration, + setSourcecastStatus +} from 'src/features/sourceRecorder/SourceRecorderActions'; import { CodeDelta, Input, @@ -78,7 +66,19 @@ import { PlaybackData, PlaybackStatus, RecordingStatus -} from '../../../features/sourceRecorder/SourceRecorderTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { + deleteSourcecastEntry, + recordInit, + recordInput, + resetInputs, + timerPause, + timerReset, + timerResume, + timerStart, + timerStop +} from 'src/features/sourceRecorder/sourcereel/SourcereelActions'; + import SourcereelControlbar from './subcomponents/SourcereelControlbar'; const workspaceLocation: WorkspaceLocation = 'sourcereel'; diff --git a/src/pages/academy/sourcereel/subcomponents/SourcereelControlbar.tsx b/src/pages/academy/sourcereel/subcomponents/SourcereelControlbar.tsx index 5f5ce07b02..1af919c2d0 100644 --- a/src/pages/academy/sourcereel/subcomponents/SourcereelControlbar.tsx +++ b/src/pages/academy/sourcereel/subcomponents/SourcereelControlbar.tsx @@ -1,14 +1,13 @@ import { Card, Classes, Dialog, H1, InputGroup } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import * as React from 'react'; -import Recorder from 'yareco'; - -import ControlButton from '../../../../commons/ControlButton'; +import ControlButton from 'src/commons/ControlButton'; import { Input, PlaybackData, RecordingStatus -} from '../../../../features/sourceRecorder/SourceRecorderTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; +import Recorder from 'yareco'; type SourcereelControlbarProps = DispatchProps & StateProps; diff --git a/src/pages/achievement/Achievement.tsx b/src/pages/achievement/Achievement.tsx index 26bfd2689d..b36dbee0ab 100644 --- a/src/pages/achievement/Achievement.tsx +++ b/src/pages/achievement/Achievement.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Route, Routes } from 'react-router'; +import { Role } from 'src/commons/application/ApplicationTypes'; import { useTypedSelector } from 'src/commons/utils/Hooks'; +import NotFound from 'src/pages/notFound/NotFound'; -import { Role } from '../../commons/application/ApplicationTypes'; -import NotFound from '../notFound/NotFound'; import AchievementControl from './control/AchievementControlContainer'; import AchievementDashboard from './subcomponents/AchievementDashboardContainer'; diff --git a/src/pages/achievement/control/AchievementControl.tsx b/src/pages/achievement/control/AchievementControl.tsx index 23e1c39854..30c99e99cc 100644 --- a/src/pages/achievement/control/AchievementControl.tsx +++ b/src/pages/achievement/control/AchievementControl.tsx @@ -1,12 +1,11 @@ import { useEffect, useReducer, useState } from 'react'; - -import AchievementEditor from '../../../commons/achievement/control/AchievementEditor'; -import AchievementPreview from '../../../commons/achievement/control/AchievementPreview'; -import GoalEditor from '../../../commons/achievement/control/GoalEditor'; -import AchievementInferencer from '../../../commons/achievement/utils/AchievementInferencer'; -import { Prompt } from '../../../commons/ReactRouterPrompt'; -import { AchievementContext } from '../../../features/achievement/AchievementConstants'; -import { AchievementItem, GoalDefinition } from '../../../features/achievement/AchievementTypes'; +import AchievementEditor from 'src/commons/achievement/control/AchievementEditor'; +import AchievementPreview from 'src/commons/achievement/control/AchievementPreview'; +import GoalEditor from 'src/commons/achievement/control/GoalEditor'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import { Prompt } from 'src/commons/ReactRouterPrompt'; +import { AchievementContext } from 'src/features/achievement/AchievementConstants'; +import { AchievementItem, GoalDefinition } from 'src/features/achievement/AchievementTypes'; export type DispatchProps = { bulkUpdateAchievements: (achievements: AchievementItem[]) => void; diff --git a/src/pages/achievement/control/AchievementControlContainer.ts b/src/pages/achievement/control/AchievementControlContainer.ts index 10ee15c2e3..62cdb0ca4c 100644 --- a/src/pages/achievement/control/AchievementControlContainer.ts +++ b/src/pages/achievement/control/AchievementControlContainer.ts @@ -1,8 +1,7 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; - -import AchievementInferencer from '../../../commons/achievement/utils/AchievementInferencer'; -import { OverallState } from '../../../commons/application/ApplicationTypes'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; import { bulkUpdateAchievements, bulkUpdateGoals, @@ -10,7 +9,8 @@ import { getOwnGoals, removeAchievement, removeGoal -} from '../../../features/achievement/AchievementActions'; +} from 'src/features/achievement/AchievementActions'; + import AchievementControl, { DispatchProps, StateProps } from './AchievementControl'; const mapStateToProps: MapStateToProps = state => ({ diff --git a/src/pages/achievement/subcomponents/AchievementDashboard.tsx b/src/pages/achievement/subcomponents/AchievementDashboard.tsx index 6b3d2bb492..451bab2f34 100644 --- a/src/pages/achievement/subcomponents/AchievementDashboard.tsx +++ b/src/pages/achievement/subcomponents/AchievementDashboard.tsx @@ -1,24 +1,23 @@ import { IconNames } from '@blueprintjs/icons'; import React, { useEffect, useState } from 'react'; +import AchievementFilter from 'src/commons/achievement/AchievementFilter'; +import AchievementManualEditor from 'src/commons/achievement/AchievementManualEditor'; +import AchievementOverview from 'src/commons/achievement/AchievementOverview'; +import AchievementTask from 'src/commons/achievement/AchievementTask'; +import AchievementView from 'src/commons/achievement/AchievementView'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import insertFakeAchievements from 'src/commons/achievement/utils/InsertFakeAchievements'; import { Role } from 'src/commons/application/ApplicationTypes'; import { AssessmentConfiguration, AssessmentOverview } from 'src/commons/assessment/AssessmentTypes'; - -import AchievementFilter from '../../../commons/achievement/AchievementFilter'; -import AchievementManualEditor from '../../../commons/achievement/AchievementManualEditor'; -import AchievementOverview from '../../../commons/achievement/AchievementOverview'; -import AchievementTask from '../../../commons/achievement/AchievementTask'; -import AchievementView from '../../../commons/achievement/AchievementView'; -import AchievementInferencer from '../../../commons/achievement/utils/AchievementInferencer'; -import insertFakeAchievements from '../../../commons/achievement/utils/InsertFakeAchievements'; -import { AchievementContext } from '../../../features/achievement/AchievementConstants'; +import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import { AchievementUser, FilterStatus, GoalProgress -} from '../../../features/achievement/AchievementTypes'; +} from 'src/features/achievement/AchievementTypes'; export type DispatchProps = { fetchAssessmentOverviews: () => void; diff --git a/src/pages/achievement/subcomponents/AchievementDashboardContainer.ts b/src/pages/achievement/subcomponents/AchievementDashboardContainer.ts index c18c1ab475..eee7686cea 100644 --- a/src/pages/achievement/subcomponents/AchievementDashboardContainer.ts +++ b/src/pages/achievement/subcomponents/AchievementDashboardContainer.ts @@ -1,9 +1,8 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; - -import AchievementInferencer from '../../../commons/achievement/utils/AchievementInferencer'; -import { fetchAssessmentOverviews } from '../../../commons/application/actions/SessionActions'; -import { OverallState } from '../../../commons/application/ApplicationTypes'; +import AchievementInferencer from 'src/commons/achievement/utils/AchievementInferencer'; +import { fetchAssessmentOverviews } from 'src/commons/application/actions/SessionActions'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; import { getAchievements, getGoals, @@ -11,7 +10,8 @@ import { getUserAssessmentOverviews, getUsers, updateGoalProgress -} from '../../../features/achievement/AchievementActions'; +} from 'src/features/achievement/AchievementActions'; + import Dashboard, { DispatchProps, StateProps } from './AchievementDashboard'; const mapStateToProps: MapStateToProps = state => ({ diff --git a/src/pages/contributors/subcomponents/ContributorsDetails.tsx b/src/pages/contributors/subcomponents/ContributorsDetails.tsx index 446e8ab202..6ab97843ba 100644 --- a/src/pages/contributors/subcomponents/ContributorsDetails.tsx +++ b/src/pages/contributors/subcomponents/ContributorsDetails.tsx @@ -1,7 +1,6 @@ import { Card, Elevation, H3, H5 } from '@blueprintjs/core'; import React from 'react'; - -import { Links } from '../../../commons/utils/Constants'; +import { Links } from 'src/commons/utils/Constants'; const dot = ; diff --git a/src/pages/contributors/subcomponents/ContributorsGithubApi.ts b/src/pages/contributors/subcomponents/ContributorsGithubApi.ts index 1f32e34666..f17da09fd9 100644 --- a/src/pages/contributors/subcomponents/ContributorsGithubApi.ts +++ b/src/pages/contributors/subcomponents/ContributorsGithubApi.ts @@ -1,8 +1,4 @@ -import { - ContributorsInApi, - Repo, - ReposInApi -} from '../../../features/contributors/ContributorsTypes'; +import { ContributorsInApi, Repo, ReposInApi } from 'src/features/contributors/ContributorsTypes'; const apiRepoDetails: string = 'https://api.github.com/orgs/source-academy/repos'; const ignoreRepos: string[] = ['assessments', 'tools', 'source-academy2']; diff --git a/src/pages/contributors/subcomponents/ContributorsList.tsx b/src/pages/contributors/subcomponents/ContributorsList.tsx index cea6cd6ee0..77331d8409 100644 --- a/src/pages/contributors/subcomponents/ContributorsList.tsx +++ b/src/pages/contributors/subcomponents/ContributorsList.tsx @@ -1,7 +1,7 @@ import { Card, Elevation, H2, H3, H5 } from '@blueprintjs/core'; import React, { useEffect, useState } from 'react'; +import { Contributor, Repo } from 'src/features/contributors/ContributorsTypes'; -import { Contributor, Repo } from '../../../features/contributors/ContributorsTypes'; import { fetchContributors, fetchRepos } from './ContributorsGithubApi'; const ContributorsList: React.FC = () => { diff --git a/src/pages/createStore.ts b/src/pages/createStore.ts index c82bfcb947..fdf43f750e 100644 --- a/src/pages/createStore.ts +++ b/src/pages/createStore.ts @@ -1,11 +1,11 @@ import { throttle } from 'lodash'; import { applyMiddleware, compose, createStore as _createStore } from 'redux'; import createSagaMiddleware from 'redux-saga'; +import { defaultState } from 'src/commons/application/ApplicationTypes'; +import createRootReducer from 'src/commons/application/reducers/RootReducer'; +import MainSaga from 'src/commons/sagas/MainSaga'; +import { generateOctokitInstance } from 'src/commons/utils/GitHubPersistenceHelper'; -import { defaultState } from '../commons/application/ApplicationTypes'; -import createRootReducer from '../commons/application/reducers/RootReducer'; -import MainSaga from '../commons/sagas/MainSaga'; -import { generateOctokitInstance } from '../commons/utils/GitHubPersistenceHelper'; import { loadStoredState, SavedState, saveState } from './localStorage'; export const store = createStore(); diff --git a/src/pages/fileSystem/createInBrowserFileSystem.ts b/src/pages/fileSystem/createInBrowserFileSystem.ts index 86ab66b937..7ac2d123c4 100644 --- a/src/pages/fileSystem/createInBrowserFileSystem.ts +++ b/src/pages/fileSystem/createInBrowserFileSystem.ts @@ -2,11 +2,10 @@ import { BFSRequire, configure } from 'browserfs'; import { ApiError } from 'browserfs/dist/node/core/api_error'; import { FSModule } from 'browserfs/dist/node/core/FS'; import { Store } from 'redux'; - -import { OverallState } from '../../commons/application/ApplicationTypes'; -import { setInBrowserFileSystem } from '../../commons/fileSystem/FileSystemActions'; -import { writeFileRecursively } from '../../commons/fileSystem/utils'; -import { EditorTabState, WorkspaceManagerState } from '../../commons/workspace/WorkspaceTypes'; +import { OverallState } from 'src/commons/application/ApplicationTypes'; +import { setInBrowserFileSystem } from 'src/commons/fileSystem/FileSystemActions'; +import { writeFileRecursively } from 'src/commons/fileSystem/utils'; +import { EditorTabState, WorkspaceManagerState } from 'src/commons/workspace/WorkspaceTypes'; /** * Maps workspaces to their file system base path. diff --git a/src/pages/githubAssessments/GitHubAssessmentDefaultValues.ts b/src/pages/githubAssessments/GitHubAssessmentDefaultValues.ts index ae2c20cecd..7b08a6ef44 100644 --- a/src/pages/githubAssessments/GitHubAssessmentDefaultValues.ts +++ b/src/pages/githubAssessments/GitHubAssessmentDefaultValues.ts @@ -1,7 +1,6 @@ import { Chapter } from 'js-slang/dist/types'; - -import { IMCQQuestion } from '../../commons/assessment/AssessmentTypes'; -import { MissionMetadata, TaskData } from '../../commons/githubAssessments/GitHubMissionTypes'; +import { IMCQQuestion } from 'src/commons/assessment/AssessmentTypes'; +import { MissionMetadata, TaskData } from 'src/commons/githubAssessments/GitHubMissionTypes'; export const defaultMissionBriefing = `### Assignment Briefing (Click to Edit!) Welcome to Assignment Creator! This is where the Briefing for each assignment will appear. diff --git a/src/pages/githubAssessments/GitHubAssessmentListing.tsx b/src/pages/githubAssessments/GitHubAssessmentListing.tsx index aa03003285..bddf4bcef8 100644 --- a/src/pages/githubAssessments/GitHubAssessmentListing.tsx +++ b/src/pages/githubAssessments/GitHubAssessmentListing.tsx @@ -12,11 +12,11 @@ import { import { IconNames } from '@blueprintjs/icons'; import { useMemo } from 'react'; import { NavigateFunction, useNavigate } from 'react-router'; +import defaultCoverImage from 'src/assets/default_cover_image.jpg'; +import ContentDisplay from 'src/commons/ContentDisplay'; +import Markdown from 'src/commons/Markdown'; import { useResponsive } from 'src/commons/utils/Hooks'; -import defaultCoverImage from '../../assets/default_cover_image.jpg'; -import ContentDisplay from '../../commons/ContentDisplay'; -import Markdown from '../../commons/Markdown'; import { GHAssessmentOverview } from './GitHubClassroom'; type GitHubAssessmentListingProps = { diff --git a/src/pages/githubAssessments/GitHubAssessmentWorkspace.tsx b/src/pages/githubAssessments/GitHubAssessmentWorkspace.tsx index 18db93619c..f447ae9459 100644 --- a/src/pages/githubAssessments/GitHubAssessmentWorkspace.tsx +++ b/src/pages/githubAssessments/GitHubAssessmentWorkspace.tsx @@ -15,7 +15,58 @@ import { isEqual } from 'lodash'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useLocation, useNavigate } from 'react-router'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { Testcase } from 'src/commons/assessment/AssessmentTypes'; +import { ControlBarProps } from 'src/commons/controlBar/ControlBar'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { ControlBarNextButton } from 'src/commons/controlBar/ControlBarNextButton'; +import { ControlBarPreviousButton } from 'src/commons/controlBar/ControlBarPreviousButton'; +import { ControlBarQuestionViewButton } from 'src/commons/controlBar/ControlBarQuestionViewButton'; +import { ControlBarResetButton } from 'src/commons/controlBar/ControlBarResetButton'; +import { ControlBarRunButton } from 'src/commons/controlBar/ControlBarRunButton'; +import { ControlButtonSaveButton } from 'src/commons/controlBar/ControlBarSaveButton'; +import { ControlBarDisplayMCQButton } from 'src/commons/controlBar/github/ControlBarDisplayMCQButton'; +import { ControlBarTaskAddButton } from 'src/commons/controlBar/github/ControlBarTaskAddButton'; +import { ControlBarTaskDeleteButton } from 'src/commons/controlBar/github/ControlBarTaskDeleteButton'; +import { + convertEditorTabStateToProps, + NormalEditorContainerProps +} from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import { + GitHubMissionCreateDialog, + GitHubMissionCreateDialogProps, + GitHubMissionCreateDialogResolution +} from 'src/commons/githubAssessments/GitHubMissionCreateDialog'; +import { + convertIMCQQuestionToMCQText, + convertToMCQQuestionIfMCQText, + discoverFilesToBeChangedWithMissionRepoData, + discoverFilesToBeCreatedWithoutMissionRepoData, + getMissionData +} from 'src/commons/githubAssessments/GitHubMissionDataUtils'; +import { + MissionData, + MissionMetadata, + MissionRepoData, + TaskData +} from 'src/commons/githubAssessments/GitHubMissionTypes'; +import Markdown from 'src/commons/Markdown'; +import { MobileSideContentProps } from 'src/commons/mobileWorkspace/mobileSideContent/MobileSideContent'; +import MobileWorkspace, { MobileWorkspaceProps } from 'src/commons/mobileWorkspace/MobileWorkspace'; +import SideContentMarkdownEditor from 'src/commons/sideContent/githubAssessments/SideContentMarkdownEditor'; +import SideContentMissionEditor from 'src/commons/sideContent/githubAssessments/SideContentMissionEditor'; +import SideContentTaskEditor from 'src/commons/sideContent/githubAssessments/SideContentTaskEditor'; +import SideContentTestcaseEditor from 'src/commons/sideContent/githubAssessments/SideContentTestcaseEditor'; +import { SideContentProps } from 'src/commons/sideContent/SideContent'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import Constants from 'src/commons/utils/Constants'; +import { promisifyDialog, showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { browseReplHistoryDown, browseReplHistoryUp, @@ -35,68 +86,15 @@ import { updateReplValue, updateWorkspace } from 'src/commons/workspace/WorkspaceActions'; - -import { ExternalLibraryName } from '../../commons/application/types/ExternalTypes'; -import { Testcase } from '../../commons/assessment/AssessmentTypes'; -import { ControlBarProps } from '../../commons/controlBar/ControlBar'; -import { ControlBarChapterSelect } from '../../commons/controlBar/ControlBarChapterSelect'; -import { ControlBarClearButton } from '../../commons/controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../../commons/controlBar/ControlBarEvalButton'; -import { ControlBarNextButton } from '../../commons/controlBar/ControlBarNextButton'; -import { ControlBarPreviousButton } from '../../commons/controlBar/ControlBarPreviousButton'; -import { ControlBarQuestionViewButton } from '../../commons/controlBar/ControlBarQuestionViewButton'; -import { ControlBarResetButton } from '../../commons/controlBar/ControlBarResetButton'; -import { ControlBarRunButton } from '../../commons/controlBar/ControlBarRunButton'; -import { ControlButtonSaveButton } from '../../commons/controlBar/ControlBarSaveButton'; -import { ControlBarDisplayMCQButton } from '../../commons/controlBar/github/ControlBarDisplayMCQButton'; -import { ControlBarTaskAddButton } from '../../commons/controlBar/github/ControlBarTaskAddButton'; -import { ControlBarTaskDeleteButton } from '../../commons/controlBar/github/ControlBarTaskDeleteButton'; -import { - convertEditorTabStateToProps, - NormalEditorContainerProps -} from '../../commons/editor/EditorContainer'; -import { Position } from '../../commons/editor/EditorTypes'; -import { - GitHubMissionCreateDialog, - GitHubMissionCreateDialogProps, - GitHubMissionCreateDialogResolution -} from '../../commons/githubAssessments/GitHubMissionCreateDialog'; -import { - convertIMCQQuestionToMCQText, - convertToMCQQuestionIfMCQText, - discoverFilesToBeChangedWithMissionRepoData, - discoverFilesToBeCreatedWithoutMissionRepoData, - getMissionData -} from '../../commons/githubAssessments/GitHubMissionDataUtils'; -import { - MissionData, - MissionMetadata, - MissionRepoData, - TaskData -} from '../../commons/githubAssessments/GitHubMissionTypes'; -import Markdown from '../../commons/Markdown'; -import { MobileSideContentProps } from '../../commons/mobileWorkspace/mobileSideContent/MobileSideContent'; -import MobileWorkspace, { - MobileWorkspaceProps -} from '../../commons/mobileWorkspace/MobileWorkspace'; -import SideContentMarkdownEditor from '../../commons/sideContent/githubAssessments/SideContentMarkdownEditor'; -import SideContentMissionEditor from '../../commons/sideContent/githubAssessments/SideContentMissionEditor'; -import SideContentTaskEditor from '../../commons/sideContent/githubAssessments/SideContentTaskEditor'; -import SideContentTestcaseEditor from '../../commons/sideContent/githubAssessments/SideContentTestcaseEditor'; -import { SideContentProps } from '../../commons/sideContent/SideContent'; -import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; -import Constants from '../../commons/utils/Constants'; -import { promisifyDialog, showSimpleConfirmDialog } from '../../commons/utils/DialogHelper'; -import { showWarningMessage } from '../../commons/utils/notifications/NotificationsHelper'; -import Workspace, { WorkspaceProps } from '../../commons/workspace/Workspace'; -import { WorkspaceLocation, WorkspaceState } from '../../commons/workspace/WorkspaceTypes'; +import { WorkspaceLocation, WorkspaceState } from 'src/commons/workspace/WorkspaceTypes'; import { checkIfFileCanBeSavedAndGetSaveType, getGitHubOctokitInstance, performCreatingSave, performFolderDeletion, performOverwritingSave -} from '../../features/github/GitHubUtils'; +} from 'src/features/github/GitHubUtils'; + import { defaultMCQQuestion, defaultMissionBriefing, diff --git a/src/pages/githubAssessments/GitHubClassroom.tsx b/src/pages/githubAssessments/GitHubClassroom.tsx index ca6448c799..4a7b46b30b 100644 --- a/src/pages/githubAssessments/GitHubClassroom.tsx +++ b/src/pages/githubAssessments/GitHubClassroom.tsx @@ -7,13 +7,13 @@ import { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { loginGitHub, logoutGitHub } from 'src/commons/application/actions/SessionActions'; +import ContentDisplay from 'src/commons/ContentDisplay'; +import { MissionRepoData } from 'src/commons/githubAssessments/GitHubMissionTypes'; +import GitHubAssessmentsNavigationBar from 'src/commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar'; import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { assessmentTypeLink } from 'src/commons/utils/ParamParseHelper'; -import ContentDisplay from '../../commons/ContentDisplay'; -import { MissionRepoData } from '../../commons/githubAssessments/GitHubMissionTypes'; -import GitHubAssessmentsNavigationBar from '../../commons/navigationBar/subcomponents/GitHubAssessmentsNavigationBar'; -import { showWarningMessage } from '../../commons/utils/notifications/NotificationsHelper'; -import { assessmentTypeLink } from '../../commons/utils/ParamParseHelper'; import GitHubAssessmentListing from './GitHubAssessmentListing'; import GitHubAssessmentWorkspace from './GitHubAssessmentWorkspace'; import GitHubClassroomWelcome from './GitHubClassroomWelcome'; diff --git a/src/pages/githubCallback/GitHubCallback.tsx b/src/pages/githubCallback/GitHubCallback.tsx index 4c899e17f4..c4a17172bb 100644 --- a/src/pages/githubCallback/GitHubCallback.tsx +++ b/src/pages/githubCallback/GitHubCallback.tsx @@ -4,10 +4,9 @@ import classNames from 'classnames'; import * as qs from 'query-string'; import { useEffect, useState } from 'react'; import { useLocation } from 'react-router'; - -import Constants from '../../commons/utils/Constants'; -import { parseQuery } from '../../commons/utils/QueryHelper'; -import * as GitHubUtils from '../../features/github/GitHubUtils'; +import Constants from 'src/commons/utils/Constants'; +import { parseQuery } from 'src/commons/utils/QueryHelper'; +import * as GitHubUtils from 'src/features/github/GitHubUtils'; /** * The page that the user is redirected to after they have approved the app through GitHub. diff --git a/src/pages/localStorage.ts b/src/pages/localStorage.ts index 8e3b36531d..2605f35fe9 100644 --- a/src/pages/localStorage.ts +++ b/src/pages/localStorage.ts @@ -1,14 +1,13 @@ import { Chapter, Variant } from 'js-slang/dist/types'; import { compressToUTF16, decompressFromUTF16 } from 'lz-string'; +import { OverallState, SALanguage } from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { SessionState } from 'src/commons/application/types/SessionTypes'; +import { showWarningMessage } from 'src/commons/utils/notifications/NotificationsHelper'; +import { EditorTabState } from 'src/commons/workspace/WorkspaceTypes'; +import { AchievementItem } from 'src/features/achievement/AchievementTypes'; import { StoriesAuthState } from 'src/features/stories/StoriesTypes'; -import { OverallState, SALanguage } from '../commons/application/ApplicationTypes'; -import { ExternalLibraryName } from '../commons/application/types/ExternalTypes'; -import { SessionState } from '../commons/application/types/SessionTypes'; -import { showWarningMessage } from '../commons/utils/notifications/NotificationsHelper'; -import { EditorTabState } from '../commons/workspace/WorkspaceTypes'; -import { AchievementItem } from '../features/achievement/AchievementTypes'; - // In JSON, missing keys & keys with the value 'null' are both // deserialised into 'null'. In order to differentiate between // the two cases, we wrap nullable values in an object. Missing diff --git a/src/pages/login/Login.tsx b/src/pages/login/Login.tsx index 67501081a9..3faf07418c 100644 --- a/src/pages/login/Login.tsx +++ b/src/pages/login/Login.tsx @@ -14,11 +14,10 @@ import classNames from 'classnames'; import * as React from 'react'; import { useDispatch } from 'react-redux'; import { useLocation, useNavigate } from 'react-router'; +import { fetchAuth, login } from 'src/commons/application/actions/SessionActions'; +import Constants from 'src/commons/utils/Constants'; import { useSession } from 'src/commons/utils/Hooks'; - -import { fetchAuth, login } from '../../commons/application/actions/SessionActions'; -import Constants from '../../commons/utils/Constants'; -import { parseQuery } from '../../commons/utils/QueryHelper'; +import { parseQuery } from 'src/commons/utils/QueryHelper'; const providers = [...Constants.authProviders.entries()].map(([id, { name }]) => ({ id, diff --git a/src/pages/missionControl/MissionControl.tsx b/src/pages/missionControl/MissionControl.tsx index b37ec9fd79..a95568e1e5 100644 --- a/src/pages/missionControl/MissionControl.tsx +++ b/src/pages/missionControl/MissionControl.tsx @@ -1,18 +1,17 @@ import React, { useState } from 'react'; import { Navigate, useParams } from 'react-router'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; -import { numberRegExp } from 'src/features/academy/AcademyTypes'; - -import { AssessmentStatuses } from '../../commons/assessment/AssessmentTypes'; -import ContentDisplay from '../../commons/ContentDisplay'; -import { EditingOverviewCard } from '../../commons/editingOverviewCard/EditingOverviewCard'; +import { AssessmentStatuses } from 'src/commons/assessment/AssessmentTypes'; +import ContentDisplay from 'src/commons/ContentDisplay'; +import { EditingOverviewCard } from 'src/commons/editingOverviewCard/EditingOverviewCard'; import EditingWorkspace, { EditingWorkspaceProps -} from '../../commons/editingWorkspace/EditingWorkspace'; -import MissionCreator from '../../commons/missionCreator/MissionCreatorContainer'; -import Constants from '../../commons/utils/Constants'; -import { convertParamToInt } from '../../commons/utils/ParamParseHelper'; -import { retrieveLocalAssessmentOverview } from '../../commons/XMLParser/XMLParserHelper'; +} from 'src/commons/editingWorkspace/EditingWorkspace'; +import MissionCreator from 'src/commons/missionCreator/MissionCreatorContainer'; +import Constants from 'src/commons/utils/Constants'; +import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { convertParamToInt } from 'src/commons/utils/ParamParseHelper'; +import { retrieveLocalAssessmentOverview } from 'src/commons/XMLParser/XMLParserHelper'; +import { numberRegExp } from 'src/features/academy/AcademyTypes'; const nullFunction = () => {}; diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index fb84485c19..171f0cb476 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -22,16 +22,51 @@ import { logoutGitHub, logoutGoogle } from 'src/commons/application/actions/SessionActions'; +import { + getDefaultFilePath, + getLanguageConfig, + isSourceLanguage, + OverallState, + ResultOutput, + SALanguage +} from 'src/commons/application/ApplicationTypes'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; import { setEditorSessionId, setSharedbConnected } from 'src/commons/collabEditing/CollabEditingActions'; +import { ControlBarAutorunButtons } from 'src/commons/controlBar/ControlBarAutorunButtons'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { ControlBarExecutionTime } from 'src/commons/controlBar/ControlBarExecutionTime'; +import { ControlBarGoogleDriveButtons } from 'src/commons/controlBar/ControlBarGoogleDriveButtons'; +import { ControlBarSessionButtons } from 'src/commons/controlBar/ControlBarSessionButton'; +import { ControlBarShareButton } from 'src/commons/controlBar/ControlBarShareButton'; +import { ControlBarStepLimit } from 'src/commons/controlBar/ControlBarStepLimit'; +import { ControlBarToggleFolderModeButton } from 'src/commons/controlBar/ControlBarToggleFolderModeButton'; +import { ControlBarGitHubButtons } from 'src/commons/controlBar/github/ControlBarGitHubButtons'; +import { + convertEditorTabStateToProps, + NormalEditorContainerProps +} from 'src/commons/editor/EditorContainer'; +import { Position } from 'src/commons/editor/EditorTypes'; +import { overwriteFilesInWorkspace } from 'src/commons/fileSystem/utils'; +import FileSystemView from 'src/commons/fileSystemView/FileSystemView'; +import MobileWorkspace, { MobileWorkspaceProps } from 'src/commons/mobileWorkspace/MobileWorkspace'; +import { SideBarTab } from 'src/commons/sideBar/SideBar'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import { Links } from 'src/commons/utils/Constants'; import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; +import { generateLanguageIntroduction } from 'src/commons/utils/IntroductionHelper'; +import { convertParamToBoolean, convertParamToInt } from 'src/commons/utils/ParamParseHelper'; +import { IParsedQuery, parseQuery } from 'src/commons/utils/QueryHelper'; import { showFullJSWarningOnUrlLoad, showFulTSWarningOnUrlLoad, showHTMLDisclaimer } from 'src/commons/utils/WarningDialogHelper'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { addEditorTab, addHtmlConsoleError, @@ -65,6 +100,7 @@ import { } from 'src/commons/workspace/WorkspaceActions'; import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; import EnvVisualizer from 'src/features/envVisualizer/EnvVisualizer'; +import { initSession, log } from 'src/features/eventLogging'; import { githubOpenFile, githubSaveFile, @@ -82,51 +118,9 @@ import { shortenURL, updateShortURL } from 'src/features/playground/PlaygroundActions'; +import { CodeDelta, Input, SelectionRange } from 'src/features/sourceRecorder/SourceRecorderTypes'; +import { WORKSPACE_BASE_PATHS } from 'src/pages/fileSystem/createInBrowserFileSystem'; -import { - getDefaultFilePath, - getLanguageConfig, - isSourceLanguage, - OverallState, - ResultOutput, - SALanguage -} from '../../commons/application/ApplicationTypes'; -import { ExternalLibraryName } from '../../commons/application/types/ExternalTypes'; -import { ControlBarAutorunButtons } from '../../commons/controlBar/ControlBarAutorunButtons'; -import { ControlBarChapterSelect } from '../../commons/controlBar/ControlBarChapterSelect'; -import { ControlBarClearButton } from '../../commons/controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../../commons/controlBar/ControlBarEvalButton'; -import { ControlBarExecutionTime } from '../../commons/controlBar/ControlBarExecutionTime'; -import { ControlBarGoogleDriveButtons } from '../../commons/controlBar/ControlBarGoogleDriveButtons'; -import { ControlBarSessionButtons } from '../../commons/controlBar/ControlBarSessionButton'; -import { ControlBarShareButton } from '../../commons/controlBar/ControlBarShareButton'; -import { ControlBarStepLimit } from '../../commons/controlBar/ControlBarStepLimit'; -import { ControlBarToggleFolderModeButton } from '../../commons/controlBar/ControlBarToggleFolderModeButton'; -import { ControlBarGitHubButtons } from '../../commons/controlBar/github/ControlBarGitHubButtons'; -import { - convertEditorTabStateToProps, - NormalEditorContainerProps -} from '../../commons/editor/EditorContainer'; -import { Position } from '../../commons/editor/EditorTypes'; -import { overwriteFilesInWorkspace } from '../../commons/fileSystem/utils'; -import FileSystemView from '../../commons/fileSystemView/FileSystemView'; -import MobileWorkspace, { - MobileWorkspaceProps -} from '../../commons/mobileWorkspace/MobileWorkspace'; -import { SideBarTab } from '../../commons/sideBar/SideBar'; -import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; -import { Links } from '../../commons/utils/Constants'; -import { generateLanguageIntroduction } from '../../commons/utils/IntroductionHelper'; -import { convertParamToBoolean, convertParamToInt } from '../../commons/utils/ParamParseHelper'; -import { IParsedQuery, parseQuery } from '../../commons/utils/QueryHelper'; -import Workspace, { WorkspaceProps } from '../../commons/workspace/Workspace'; -import { initSession, log } from '../../features/eventLogging'; -import { - CodeDelta, - Input, - SelectionRange -} from '../../features/sourceRecorder/SourceRecorderTypes'; -import { WORKSPACE_BASE_PATHS } from '../fileSystem/createInBrowserFileSystem'; import { dataVisualizerTab, desktopOnlyTabIds, diff --git a/src/pages/playground/PlaygroundTabs.tsx b/src/pages/playground/PlaygroundTabs.tsx index b60367ee7f..aefb7af808 100644 --- a/src/pages/playground/PlaygroundTabs.tsx +++ b/src/pages/playground/PlaygroundTabs.tsx @@ -1,16 +1,15 @@ import { IconNames } from '@blueprintjs/icons'; import { isStepperOutput } from 'js-slang/dist/stepper/stepper'; +import { InterpreterOutput, ResultOutput } from 'src/commons/application/ApplicationTypes'; +import Markdown from 'src/commons/Markdown'; import SideContentRemoteExecution from 'src/commons/sideContent/remoteExecution/SideContentRemoteExecution'; +import SideContentDataVisualizer from 'src/commons/sideContent/SideContentDataVisualizer'; import SideContentEnvVisualizer from 'src/commons/sideContent/SideContentEnvVisualizer'; +import SideContentHtmlDisplay from 'src/commons/sideContent/SideContentHtmlDisplay'; import SideContentSubstVisualizer from 'src/commons/sideContent/SideContentSubstVisualizer'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; import { WorkspaceLocation } from 'src/commons/workspace/WorkspaceTypes'; -import { InterpreterOutput, ResultOutput } from '../../commons/application/ApplicationTypes'; -import Markdown from '../../commons/Markdown'; -import SideContentDataVisualizer from '../../commons/sideContent/SideContentDataVisualizer'; -import SideContentHtmlDisplay from '../../commons/sideContent/SideContentHtmlDisplay'; -import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; - export const mobileOnlyTabIds: readonly SideContentType[] = [ SideContentType.mobileEditor, SideContentType.mobileEditorRun diff --git a/src/pages/sicp/Sicp.tsx b/src/pages/sicp/Sicp.tsx index bf9bbe6efe..98ed984c97 100644 --- a/src/pages/sicp/Sicp.tsx +++ b/src/pages/sicp/Sicp.tsx @@ -8,6 +8,8 @@ import { useLocation, useNavigate, useParams } from 'react-router'; import Constants from 'src/commons/utils/Constants'; import { setLocalStorage } from 'src/commons/utils/LocalStorageHelper'; import { resetWorkspace, toggleUsingSubst } from 'src/commons/workspace/WorkspaceActions'; +import SicpErrorBoundary from 'src/features/sicp/errors/SicpErrorBoundary'; +import getSicpError, { SicpErrorType } from 'src/features/sicp/errors/SicpErrors'; import { parseArr, ParseJsonError } from 'src/features/sicp/parser/ParseJson'; import { getNext, getPrev } from 'src/features/sicp/TableOfContentsHelper'; import { @@ -17,8 +19,6 @@ import { SICP_INDEX } from 'src/features/sicp/utils/SicpUtils'; -import SicpErrorBoundary from '../../features/sicp/errors/SicpErrorBoundary'; -import getSicpError, { SicpErrorType } from '../../features/sicp/errors/SicpErrors'; import SicpIndexPage from './subcomponents/SicpIndexPage'; const baseUrl = Constants.sicpBackendUrl + 'json/'; diff --git a/src/pages/sicp/subcomponents/CodeSnippet.tsx b/src/pages/sicp/subcomponents/CodeSnippet.tsx index 2009bab192..36359e440c 100644 --- a/src/pages/sicp/subcomponents/CodeSnippet.tsx +++ b/src/pages/sicp/subcomponents/CodeSnippet.tsx @@ -8,8 +8,7 @@ import { ControlBarCloseButton } from 'src/commons/controlBar/ControlBarCloseBut import { useResponsive } from 'src/commons/utils/Hooks'; import { SourceTheme } from 'src/features/sicp/SourceTheme'; import Playground from 'src/pages/playground/Playground'; - -import { CodeSnippetContext } from '../Sicp'; +import { CodeSnippetContext } from 'src/pages/sicp/Sicp'; export type CodeSnippetProps = OwnProps; type OwnProps = { diff --git a/src/pages/sicp/subcomponents/SicpToc.tsx b/src/pages/sicp/subcomponents/SicpToc.tsx index 86e3fb6b4b..add2584a24 100644 --- a/src/pages/sicp/subcomponents/SicpToc.tsx +++ b/src/pages/sicp/subcomponents/SicpToc.tsx @@ -3,8 +3,7 @@ import { cloneDeep } from 'lodash'; import * as React from 'react'; import { useState } from 'react'; import { useNavigate } from 'react-router'; - -import toc from '../../../features/sicp/data/toc.json'; +import toc from 'src/features/sicp/data/toc.json'; type TocProps = OwnProps; diff --git a/src/pages/sourcecast/Sourcecast.tsx b/src/pages/sourcecast/Sourcecast.tsx index 598b26f7e1..0d6bb8f67e 100644 --- a/src/pages/sourcecast/Sourcecast.tsx +++ b/src/pages/sourcecast/Sourcecast.tsx @@ -11,8 +11,26 @@ import { debuggerReset, debuggerResume } from 'src/commons/application/actions/InterpreterActions'; +import { ExternalLibraryName } from 'src/commons/application/types/ExternalTypes'; +import { ControlBarAutorunButtons } from 'src/commons/controlBar/ControlBarAutorunButtons'; +import { ControlBarChapterSelect } from 'src/commons/controlBar/ControlBarChapterSelect'; +import { ControlBarClearButton } from 'src/commons/controlBar/ControlBarClearButton'; +import { ControlBarEvalButton } from 'src/commons/controlBar/ControlBarEvalButton'; +import { + convertEditorTabStateToProps, + SourcecastEditorContainerProps +} from 'src/commons/editor/EditorContainer'; import { Position } from 'src/commons/editor/EditorTypes'; +import MobileWorkspace, { MobileWorkspaceProps } from 'src/commons/mobileWorkspace/MobileWorkspace'; +import SideContentDataVisualizer from 'src/commons/sideContent/SideContentDataVisualizer'; +import SideContentEnvVisualizer from 'src/commons/sideContent/SideContentEnvVisualizer'; +import { SideContentTab, SideContentType } from 'src/commons/sideContent/SideContentTypes'; +import SourceRecorderControlBar, { + SourceRecorderControlBarProps +} from 'src/commons/sourceRecorder/SourceRecorderControlBar'; +import SourceRecorderTable from 'src/commons/sourceRecorder/SourceRecorderTable'; import { useResponsive, useTypedSelector } from 'src/commons/utils/Hooks'; +import Workspace, { WorkspaceProps } from 'src/commons/workspace/Workspace'; import { browseReplHistoryDown, browseReplHistoryUp, @@ -42,33 +60,12 @@ import { setSourcecastDuration, setSourcecastStatus } from 'src/features/sourceRecorder/SourceRecorderActions'; - -import { ExternalLibraryName } from '../../commons/application/types/ExternalTypes'; -import { ControlBarAutorunButtons } from '../../commons/controlBar/ControlBarAutorunButtons'; -import { ControlBarChapterSelect } from '../../commons/controlBar/ControlBarChapterSelect'; -import { ControlBarClearButton } from '../../commons/controlBar/ControlBarClearButton'; -import { ControlBarEvalButton } from '../../commons/controlBar/ControlBarEvalButton'; -import { - convertEditorTabStateToProps, - SourcecastEditorContainerProps -} from '../../commons/editor/EditorContainer'; -import MobileWorkspace, { - MobileWorkspaceProps -} from '../../commons/mobileWorkspace/MobileWorkspace'; -import SideContentDataVisualizer from '../../commons/sideContent/SideContentDataVisualizer'; -import SideContentEnvVisualizer from '../../commons/sideContent/SideContentEnvVisualizer'; -import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; -import SourceRecorderControlBar, { - SourceRecorderControlBarProps -} from '../../commons/sourceRecorder/SourceRecorderControlBar'; -import SourceRecorderTable from '../../commons/sourceRecorder/SourceRecorderTable'; -import Workspace, { WorkspaceProps } from '../../commons/workspace/Workspace'; import { CodeDelta, Input, PlaybackData, PlaybackStatus -} from '../../features/sourceRecorder/SourceRecorderTypes'; +} from 'src/features/sourceRecorder/SourceRecorderTypes'; const workspaceLocation: WorkspaceLocation = 'sourcecast'; diff --git a/src/pages/stories/Story.tsx b/src/pages/stories/Story.tsx index 6a9432fe42..4828d2d30d 100644 --- a/src/pages/stories/Story.tsx +++ b/src/pages/stories/Story.tsx @@ -17,8 +17,7 @@ import { setCurrentStory, setCurrentStoryId } from 'src/features/stories/StoriesActions'; - -import UserBlogContent from '../../features/stories/storiesComponents/UserBlogContent'; +import UserBlogContent from 'src/features/stories/storiesComponents/UserBlogContent'; type Props = { isViewOnly?: boolean; diff --git a/src/routes/routerConfig.tsx b/src/routes/routerConfig.tsx index b916aa374d..67aa2f3ce0 100644 --- a/src/routes/routerConfig.tsx +++ b/src/routes/routerConfig.tsx @@ -1,8 +1,7 @@ import { Navigate, redirect, RouteObject } from 'react-router'; - -import Application from '../commons/application/Application'; -import { Role } from '../commons/application/ApplicationTypes'; -import Constants from '../commons/utils/Constants'; +import Application from 'src/commons/application/Application'; +import { Role } from 'src/commons/application/ApplicationTypes'; +import Constants from 'src/commons/utils/Constants'; /** * Partial migration to be compatible with react-router v6.4 data loader APIs. diff --git a/yarn.lock b/yarn.lock index f2c654444d..5cc77cefc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5845,6 +5845,11 @@ eslint-plugin-jsx-a11y@^6.5.1: object.fromentries "^2.0.6" semver "^6.3.0" +eslint-plugin-no-relative-import-paths@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.5.2.tgz#c35f2fd0bf2a6a57b268193ed7df63ff7000134e" + integrity sha512-wMlL+TVuDhKk1plP+w3L4Hc7+u89vUkrOYq6/0ARjcYqwc9/YaS9uEXNzaqAk+WLoEgakzNL5JgJJw6m4qd5zw== + eslint-plugin-react-hooks@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"