diff --git a/.eslintrc.json b/.eslintrc.json index e1c275396..12ddcf848 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -260,7 +260,7 @@ "jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/scope": "warn", "jsx-a11y/tabindex-no-positive": "warn", - "import/extensions": ["warn", "ignorePackages"], + "import/extensions": ["error", "ignorePackages"], "import/newline-after-import": "error", "import/no-extraneous-dependencies": "error", "import/no-unresolved": "error", diff --git a/scripts/do-release.ts b/scripts/do-release.ts index f7d2dc9be..7fb69cadc 100644 --- a/scripts/do-release.ts +++ b/scripts/do-release.ts @@ -1,6 +1,6 @@ import { Gitlab } from '@gitbeaker/node'; -import { getChanges } from './lib/changelog'; +import { getChanges } from './lib/changelog.ts'; const { CI_COMMIT_TAG, diff --git a/src/actions/about.test.ts b/src/actions/about.test.ts index bd6affcd9..34e5240f7 100644 --- a/src/actions/about.test.ts +++ b/src/actions/about.test.ts @@ -1,15 +1,15 @@ import MockAdapter from 'axios-mock-adapter'; import { describe, expect, it } from 'vitest'; -import { staticClient } from 'soapbox/api'; -import { mockStore } from 'soapbox/jest/test-helpers'; +import { staticClient } from 'soapbox/api/index.ts'; +import { mockStore } from 'soapbox/jest/test-helpers.tsx'; import { FETCH_ABOUT_PAGE_REQUEST, FETCH_ABOUT_PAGE_SUCCESS, FETCH_ABOUT_PAGE_FAIL, fetchAboutPage, -} from './about'; +} from './about.ts'; describe('fetchAboutPage()', () => { it('creates the expected actions on success', () => { diff --git a/src/actions/about.ts b/src/actions/about.ts index c8410ded8..124698c1a 100644 --- a/src/actions/about.ts +++ b/src/actions/about.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; import type { AnyAction } from 'redux'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; const FETCH_ABOUT_PAGE_REQUEST = 'FETCH_ABOUT_PAGE_REQUEST'; const FETCH_ABOUT_PAGE_SUCCESS = 'FETCH_ABOUT_PAGE_SUCCESS'; diff --git a/src/actions/account-notes.test.ts b/src/actions/account-notes.test.ts index dbebf8076..6641fe39b 100644 --- a/src/actions/account-notes.test.ts +++ b/src/actions/account-notes.test.ts @@ -1,9 +1,9 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; -import { submitAccountNote } from './account-notes'; +import { submitAccountNote } from './account-notes.ts'; describe('submitAccountNote()', () => { let store: ReturnType; diff --git a/src/actions/account-notes.ts b/src/actions/account-notes.ts index 7afd5e283..ea69ccc13 100644 --- a/src/actions/account-notes.ts +++ b/src/actions/account-notes.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; import type { AnyAction } from 'redux'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; const ACCOUNT_NOTE_SUBMIT_REQUEST = 'ACCOUNT_NOTE_SUBMIT_REQUEST'; const ACCOUNT_NOTE_SUBMIT_SUCCESS = 'ACCOUNT_NOTE_SUBMIT_SUCCESS'; diff --git a/src/actions/accounts.test.ts b/src/actions/accounts.test.ts index 434da371d..3c8befcaa 100644 --- a/src/actions/accounts.test.ts +++ b/src/actions/accounts.test.ts @@ -1,11 +1,11 @@ import { Map as ImmutableMap } from 'immutable'; import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildInstance, buildRelationship } from 'soapbox/jest/factory'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { normalizeAccount } from 'soapbox/normalizers'; -import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildInstance, buildRelationship } from 'soapbox/jest/factory.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeAccount } from 'soapbox/normalizers/index.ts'; +import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists.ts'; import { authorizeFollowRequest, @@ -26,7 +26,7 @@ import { unblockAccount, unmuteAccount, unsubscribeAccount, -} from './accounts'; +} from './accounts.ts'; let store: ReturnType; diff --git a/src/actions/accounts.ts b/src/actions/accounts.ts index f1d0f6c32..7ccaf6e5c 100644 --- a/src/actions/accounts.ts +++ b/src/actions/accounts.ts @@ -1,22 +1,22 @@ -import { importEntities } from 'soapbox/entity-store/actions'; -import { Entities } from 'soapbox/entity-store/entities'; -import { selectAccount } from 'soapbox/selectors'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; +import { importEntities } from 'soapbox/entity-store/actions.ts'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; import { importFetchedAccount, importFetchedAccounts, importErrorWhileFetchingAccountByUsername, -} from './importer'; +} from './importer/index.ts'; import type { AxiosError, CancelToken } from 'axios'; import type { Map as ImmutableMap } from 'immutable'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status } from 'soapbox/types/entities'; -import type { History } from 'soapbox/types/history'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status } from 'soapbox/types/entities.ts'; +import type { History } from 'soapbox/types/history.ts'; const ACCOUNT_CREATE_REQUEST = 'ACCOUNT_CREATE_REQUEST'; const ACCOUNT_CREATE_SUCCESS = 'ACCOUNT_CREATE_SUCCESS'; diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 4dd3c1b64..2383aec95 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -1,13 +1,13 @@ -import { fetchRelationships } from 'soapbox/actions/accounts'; -import { importFetchedAccount, importFetchedAccounts, importFetchedStatuses } from 'soapbox/actions/importer'; -import { accountIdsToAccts } from 'soapbox/selectors'; -import { filterBadges, getTagDiff } from 'soapbox/utils/badges'; +import { fetchRelationships } from 'soapbox/actions/accounts.ts'; +import { importFetchedAccount, importFetchedAccounts, importFetchedStatuses } from 'soapbox/actions/importer/index.ts'; +import { accountIdsToAccts } from 'soapbox/selectors/index.ts'; +import { filterBadges, getTagDiff } from 'soapbox/utils/badges.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; import type { AxiosResponse } from 'axios'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const ADMIN_CONFIG_FETCH_REQUEST = 'ADMIN_CONFIG_FETCH_REQUEST'; const ADMIN_CONFIG_FETCH_SUCCESS = 'ADMIN_CONFIG_FETCH_SUCCESS'; diff --git a/src/actions/aliases.ts b/src/actions/aliases.ts index c582e70bb..3706c6415 100644 --- a/src/actions/aliases.ts +++ b/src/actions/aliases.ts @@ -1,16 +1,16 @@ import { defineMessages } from 'react-intl'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { importFetchedAccounts } from './importer'; -import { patchMeSuccess } from './me'; +import { importFetchedAccounts } from './importer/index.ts'; +import { patchMeSuccess } from './me.ts'; -import type { Account } from 'soapbox/schemas'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { Account } from 'soapbox/schemas/index.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const ALIASES_FETCH_REQUEST = 'ALIASES_FETCH_REQUEST'; const ALIASES_FETCH_SUCCESS = 'ALIASES_FETCH_SUCCESS'; diff --git a/src/actions/apps.ts b/src/actions/apps.ts index d2ef2ff0d..e593f418e 100644 --- a/src/actions/apps.ts +++ b/src/actions/apps.ts @@ -6,7 +6,7 @@ * @see module:soapbox/actions/auth */ -import { baseClient } from '../api'; +import { baseClient } from '../api/index.ts'; import type { AnyAction } from 'redux'; diff --git a/src/actions/auth.ts b/src/actions/auth.ts index 8847c6b32..13d4fc72a 100644 --- a/src/actions/auth.ts +++ b/src/actions/auth.ts @@ -9,28 +9,28 @@ import { defineMessages } from 'react-intl'; -import { createAccount } from 'soapbox/actions/accounts'; -import { createApp } from 'soapbox/actions/apps'; -import { fetchMeSuccess, fetchMeFail } from 'soapbox/actions/me'; -import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth'; -import { startOnboarding } from 'soapbox/actions/onboarding'; -import { custom } from 'soapbox/custom'; -import { queryClient } from 'soapbox/queries/client'; -import { selectAccount } from 'soapbox/selectors'; -import { unsetSentryAccount } from 'soapbox/sentry'; -import KVStore from 'soapbox/storage/kv-store'; -import toast from 'soapbox/toast'; -import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth'; -import sourceCode from 'soapbox/utils/code'; -import { normalizeUsername } from 'soapbox/utils/input'; -import { getScopes } from 'soapbox/utils/scopes'; +import { createAccount } from 'soapbox/actions/accounts.ts'; +import { createApp } from 'soapbox/actions/apps.ts'; +import { fetchMeSuccess, fetchMeFail } from 'soapbox/actions/me.ts'; +import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth.ts'; +import { startOnboarding } from 'soapbox/actions/onboarding.ts'; +import { custom } from 'soapbox/custom.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import { unsetSentryAccount } from 'soapbox/sentry.ts'; +import KVStore from 'soapbox/storage/kv-store.ts'; +import toast from 'soapbox/toast.tsx'; +import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth.ts'; +import sourceCode from 'soapbox/utils/code.ts'; +import { normalizeUsername } from 'soapbox/utils/input.ts'; +import { getScopes } from 'soapbox/utils/scopes.ts'; -import api, { baseClient } from '../api'; +import api, { baseClient } from '../api/index.ts'; -import { importFetchedAccount } from './importer'; +import { importFetchedAccount } from './importer/index.ts'; import type { AxiosError } from 'axios'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; export const SWITCH_ACCOUNT = 'SWITCH_ACCOUNT'; diff --git a/src/actions/backups.ts b/src/actions/backups.ts index c95e504db..dfabb1a85 100644 --- a/src/actions/backups.ts +++ b/src/actions/backups.ts @@ -1,6 +1,6 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; export const BACKUPS_FETCH_REQUEST = 'BACKUPS_FETCH_REQUEST'; export const BACKUPS_FETCH_SUCCESS = 'BACKUPS_FETCH_SUCCESS'; diff --git a/src/actions/blocks.test.ts b/src/actions/blocks.test.ts index b7a73f9eb..c0a2418d8 100644 --- a/src/actions/blocks.test.ts +++ b/src/actions/blocks.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists.ts'; -import { expandBlocks, fetchBlocks } from './blocks'; +import { expandBlocks, fetchBlocks } from './blocks.ts'; const account = { acct: 'twoods', diff --git a/src/actions/blocks.ts b/src/actions/blocks.ts index b672e778f..bada74f2a 100644 --- a/src/actions/blocks.ts +++ b/src/actions/blocks.ts @@ -1,11 +1,11 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts } from './importer'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const BLOCKS_FETCH_REQUEST = 'BLOCKS_FETCH_REQUEST'; const BLOCKS_FETCH_SUCCESS = 'BLOCKS_FETCH_SUCCESS'; diff --git a/src/actions/bookmarks.ts b/src/actions/bookmarks.ts index 9fd11d258..76a656fd2 100644 --- a/src/actions/bookmarks.ts +++ b/src/actions/bookmarks.ts @@ -1,9 +1,9 @@ -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { importFetchedStatuses } from './importer'; +import { importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const BOOKMARKED_STATUSES_FETCH_REQUEST = 'BOOKMARKED_STATUSES_FETCH_REQUEST'; const BOOKMARKED_STATUSES_FETCH_SUCCESS = 'BOOKMARKED_STATUSES_FETCH_SUCCESS'; diff --git a/src/actions/chats.ts b/src/actions/chats.ts index ee8e23239..6027530e3 100644 --- a/src/actions/chats.ts +++ b/src/actions/chats.ts @@ -1,12 +1,12 @@ import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; -import { getSettings, changeSetting } from 'soapbox/actions/settings'; -import { getFeatures } from 'soapbox/utils/features'; +import { getSettings, changeSetting } from 'soapbox/actions/settings.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { History } from 'soapbox/types/history'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { History } from 'soapbox/types/history.ts'; const CHATS_FETCH_REQUEST = 'CHATS_FETCH_REQUEST'; const CHATS_FETCH_SUCCESS = 'CHATS_FETCH_SUCCESS'; diff --git a/src/actions/compose-status.ts b/src/actions/compose-status.ts index 9a0fbf9c6..fd1379f9e 100644 --- a/src/actions/compose-status.ts +++ b/src/actions/compose-status.ts @@ -1,7 +1,7 @@ -import { AppDispatch, RootState } from 'soapbox/store'; -import { getFeatures, parseVersion } from 'soapbox/utils/features'; +import { AppDispatch, RootState } from 'soapbox/store.ts'; +import { getFeatures, parseVersion } from 'soapbox/utils/features.ts'; -import type { Status } from 'soapbox/types/entities'; +import type { Status } from 'soapbox/types/entities.ts'; export const COMPOSE_SET_STATUS = 'COMPOSE_SET_STATUS' as const; diff --git a/src/actions/compose.test.ts b/src/actions/compose.test.ts index 20cb92231..62c0b2d64 100644 --- a/src/actions/compose.test.ts +++ b/src/actions/compose.test.ts @@ -1,12 +1,12 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { buildInstance } from 'soapbox/jest/factory'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { ReducerCompose } from 'soapbox/reducers/compose'; +import { buildInstance } from 'soapbox/jest/factory.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { ReducerCompose } from 'soapbox/reducers/compose.ts'; -import { uploadCompose, submitCompose } from './compose'; -import { STATUS_CREATE_REQUEST } from './statuses'; +import { uploadCompose, submitCompose } from './compose.ts'; +import { STATUS_CREATE_REQUEST } from './statuses.ts'; import type { IntlShape } from 'react-intl'; diff --git a/src/actions/compose.ts b/src/actions/compose.ts index bdf02fe0a..b0733cda9 100644 --- a/src/actions/compose.ts +++ b/src/actions/compose.ts @@ -3,31 +3,31 @@ import { List as ImmutableList } from 'immutable'; import throttle from 'lodash/throttle'; import { defineMessages, IntlShape } from 'react-intl'; -import api from 'soapbox/api'; -import { isNativeEmoji } from 'soapbox/features/emoji'; -import emojiSearch from 'soapbox/features/emoji/search'; -import { normalizeTag } from 'soapbox/normalizers'; -import { selectAccount, selectOwnAccount } from 'soapbox/selectors'; -import { tagHistory } from 'soapbox/settings'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import api from 'soapbox/api/index.ts'; +import { isNativeEmoji } from 'soapbox/features/emoji/index.ts'; +import emojiSearch from 'soapbox/features/emoji/search.ts'; +import { normalizeTag } from 'soapbox/normalizers/index.ts'; +import { selectAccount, selectOwnAccount } from 'soapbox/selectors/index.ts'; +import { tagHistory } from 'soapbox/settings.ts'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import { ComposeSetStatusAction } from './compose-status'; -import { chooseEmoji } from './emojis'; -import { importFetchedAccounts } from './importer'; -import { uploadFile, updateMedia } from './media'; -import { openModal, closeModal } from './modals'; -import { getSettings } from './settings'; -import { createStatus } from './statuses'; +import { ComposeSetStatusAction } from './compose-status.ts'; +import { chooseEmoji } from './emojis.ts'; +import { importFetchedAccounts } from './importer/index.ts'; +import { uploadFile, updateMedia } from './media.ts'; +import { openModal, closeModal } from './modals.ts'; +import { getSettings } from './settings.ts'; +import { createStatus } from './statuses.ts'; import type { EditorState } from 'lexical'; -import type { AutoSuggestion } from 'soapbox/components/autosuggest-input'; -import type { Emoji } from 'soapbox/features/emoji'; -import type { Account, Group } from 'soapbox/schemas'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status, Tag } from 'soapbox/types/entities'; -import type { History } from 'soapbox/types/history'; +import type { AutoSuggestion } from 'soapbox/components/autosuggest-input.tsx'; +import type { Emoji } from 'soapbox/features/emoji/index.ts'; +import type { Account, Group } from 'soapbox/schemas/index.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status, Tag } from 'soapbox/types/entities.ts'; +import type { History } from 'soapbox/types/history.ts'; const { CancelToken, isCancel } = axios; diff --git a/src/actions/consumer-auth.ts b/src/actions/consumer-auth.ts index 72c928dba..27828d5fe 100644 --- a/src/actions/consumer-auth.ts +++ b/src/actions/consumer-auth.ts @@ -1,13 +1,13 @@ import axios from 'axios'; -import * as BuildConfig from 'soapbox/build-config'; -import { isURL } from 'soapbox/utils/auth'; -import sourceCode from 'soapbox/utils/code'; -import { getScopes } from 'soapbox/utils/scopes'; +import * as BuildConfig from 'soapbox/build-config.ts'; +import { isURL } from 'soapbox/utils/auth.ts'; +import sourceCode from 'soapbox/utils/code.ts'; +import { getScopes } from 'soapbox/utils/scopes.ts'; -import { createApp } from './apps'; +import { createApp } from './apps.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const createProviderApp = () => { return async(dispatch: AppDispatch, getState: () => RootState) => { diff --git a/src/actions/conversations.ts b/src/actions/conversations.ts index 5c613e9e2..6f7727404 100644 --- a/src/actions/conversations.ts +++ b/src/actions/conversations.ts @@ -1,15 +1,15 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; import { importFetchedAccounts, importFetchedStatuses, importFetchedStatus, -} from './importer'; +} from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const CONVERSATIONS_MOUNT = 'CONVERSATIONS_MOUNT'; const CONVERSATIONS_UNMOUNT = 'CONVERSATIONS_UNMOUNT'; diff --git a/src/actions/custom-emojis.ts b/src/actions/custom-emojis.ts index 2baf5213a..ad71b5c79 100644 --- a/src/actions/custom-emojis.ts +++ b/src/actions/custom-emojis.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const CUSTOM_EMOJIS_FETCH_REQUEST = 'CUSTOM_EMOJIS_FETCH_REQUEST'; const CUSTOM_EMOJIS_FETCH_SUCCESS = 'CUSTOM_EMOJIS_FETCH_SUCCESS'; diff --git a/src/actions/directory.ts b/src/actions/directory.ts index 3fd39f350..2f9e92bc0 100644 --- a/src/actions/directory.ts +++ b/src/actions/directory.ts @@ -1,10 +1,10 @@ -import api from '../api'; +import api from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts } from './importer'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const DIRECTORY_FETCH_REQUEST = 'DIRECTORY_FETCH_REQUEST'; const DIRECTORY_FETCH_SUCCESS = 'DIRECTORY_FETCH_SUCCESS'; diff --git a/src/actions/domain-blocks.ts b/src/actions/domain-blocks.ts index 81a5d73bf..3aa4f6c55 100644 --- a/src/actions/domain-blocks.ts +++ b/src/actions/domain-blocks.ts @@ -1,11 +1,11 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { isLoggedIn } from 'soapbox/utils/auth'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import type { EntityStore } from 'soapbox/entity-store/types'; -import type { Account } from 'soapbox/schemas'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { EntityStore } from 'soapbox/entity-store/types.ts'; +import type { Account } from 'soapbox/schemas/index.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const DOMAIN_BLOCK_REQUEST = 'DOMAIN_BLOCK_REQUEST'; const DOMAIN_BLOCK_SUCCESS = 'DOMAIN_BLOCK_SUCCESS'; diff --git a/src/actions/email-list.ts b/src/actions/email-list.ts index eeac0ed47..8f80f96d5 100644 --- a/src/actions/email-list.ts +++ b/src/actions/email-list.ts @@ -1,6 +1,6 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; const getSubscribersCsv = () => (dispatch: any, getState: () => RootState) => diff --git a/src/actions/emoji-reacts.ts b/src/actions/emoji-reacts.ts index 1e8991824..0ebe21c8e 100644 --- a/src/actions/emoji-reacts.ts +++ b/src/actions/emoji-reacts.ts @@ -1,14 +1,14 @@ import { List as ImmutableList } from 'immutable'; -import { isLoggedIn } from 'soapbox/utils/auth'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { importFetchedAccounts, importFetchedStatus } from './importer'; -import { favourite, unfavourite } from './interactions'; +import { importFetchedAccounts, importFetchedStatus } from './importer/index.ts'; +import { favourite, unfavourite } from './interactions.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, EmojiReaction, Status } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, EmojiReaction, Status } from 'soapbox/types/entities.ts'; const EMOJI_REACT_REQUEST = 'EMOJI_REACT_REQUEST'; const EMOJI_REACT_SUCCESS = 'EMOJI_REACT_SUCCESS'; diff --git a/src/actions/emojis.ts b/src/actions/emojis.ts index 2a959fcc3..88e73a8cf 100644 --- a/src/actions/emojis.ts +++ b/src/actions/emojis.ts @@ -1,7 +1,7 @@ -import { saveSettings } from './settings'; +import { saveSettings } from './settings.ts'; -import type { Emoji } from 'soapbox/features/emoji'; -import type { AppDispatch } from 'soapbox/store'; +import type { Emoji } from 'soapbox/features/emoji/index.ts'; +import type { AppDispatch } from 'soapbox/store.ts'; const EMOJI_CHOOSE = 'EMOJI_CHOOSE'; diff --git a/src/actions/events.ts b/src/actions/events.ts index 875b487f6..9026ac710 100644 --- a/src/actions/events.ts +++ b/src/actions/events.ts @@ -1,20 +1,20 @@ import { defineMessages, IntlShape } from 'react-intl'; -import api, { getLinks } from 'soapbox/api'; -import toast from 'soapbox/toast'; +import api, { getLinks } from 'soapbox/api/index.ts'; +import toast from 'soapbox/toast.tsx'; -import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer'; -import { uploadFile } from './media'; -import { closeModal, openModal } from './modals'; +import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer/index.ts'; +import { uploadFile } from './media.ts'; +import { closeModal, openModal } from './modals.ts'; import { STATUS_FETCH_SOURCE_FAIL, STATUS_FETCH_SOURCE_REQUEST, STATUS_FETCH_SOURCE_SUCCESS, -} from './statuses'; +} from './statuses.ts'; -import type { ReducerStatus } from 'soapbox/reducers/statuses'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status as StatusEntity } from 'soapbox/types/entities'; +import type { ReducerStatus } from 'soapbox/reducers/statuses.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status as StatusEntity } from 'soapbox/types/entities.ts'; const LOCATION_SEARCH_REQUEST = 'LOCATION_SEARCH_REQUEST' as const; const LOCATION_SEARCH_SUCCESS = 'LOCATION_SEARCH_SUCCESS' as const; diff --git a/src/actions/export-data.ts b/src/actions/export-data.ts index b5bf805de..45c1065e4 100644 --- a/src/actions/export-data.ts +++ b/src/actions/export-data.ts @@ -1,11 +1,11 @@ import { defineMessages } from 'react-intl'; -import api, { getLinks } from 'soapbox/api'; -import { normalizeAccount } from 'soapbox/normalizers'; -import toast from 'soapbox/toast'; +import api, { getLinks } from 'soapbox/api/index.ts'; +import { normalizeAccount } from 'soapbox/normalizers/index.ts'; +import toast from 'soapbox/toast.tsx'; import type { AxiosResponse } from 'axios'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; export const EXPORT_FOLLOWS_REQUEST = 'EXPORT_FOLLOWS_REQUEST'; export const EXPORT_FOLLOWS_SUCCESS = 'EXPORT_FOLLOWS_SUCCESS'; diff --git a/src/actions/external-auth.ts b/src/actions/external-auth.ts index 45d288bc5..414c67886 100644 --- a/src/actions/external-auth.ts +++ b/src/actions/external-auth.ts @@ -6,17 +6,17 @@ * @see module:soapbox/actions/oauth */ -import { createApp } from 'soapbox/actions/apps'; -import { authLoggedIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth'; -import { obtainOAuthToken } from 'soapbox/actions/oauth'; -import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance'; -import { parseBaseURL } from 'soapbox/utils/auth'; -import sourceCode from 'soapbox/utils/code'; -import { getInstanceScopes } from 'soapbox/utils/scopes'; +import { createApp } from 'soapbox/actions/apps.ts'; +import { authLoggedIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth.ts'; +import { obtainOAuthToken } from 'soapbox/actions/oauth.ts'; +import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance.ts'; +import { parseBaseURL } from 'soapbox/utils/auth.ts'; +import sourceCode from 'soapbox/utils/code.ts'; +import { getInstanceScopes } from 'soapbox/utils/scopes.ts'; -import { baseClient } from '../api'; +import { baseClient } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const fetchExternalInstance = (baseURL?: string) => { return baseClient(null, baseURL) diff --git a/src/actions/familiar-followers.ts b/src/actions/familiar-followers.ts index c23a674ba..c1a838ad6 100644 --- a/src/actions/familiar-followers.ts +++ b/src/actions/familiar-followers.ts @@ -1,11 +1,11 @@ -import { AppDispatch, RootState } from 'soapbox/store'; +import { AppDispatch, RootState } from 'soapbox/store.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts } from './importer'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { APIEntity } from 'soapbox/types/entities.ts'; export const FAMILIAR_FOLLOWERS_FETCH_REQUEST = 'FAMILIAR_FOLLOWERS_FETCH_REQUEST'; export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCESS'; diff --git a/src/actions/favourites.ts b/src/actions/favourites.ts index cfd6e1f15..d4240064c 100644 --- a/src/actions/favourites.ts +++ b/src/actions/favourites.ts @@ -1,11 +1,11 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { importFetchedStatuses } from './importer'; +import { importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST'; const FAVOURITED_STATUSES_FETCH_SUCCESS = 'FAVOURITED_STATUSES_FETCH_SUCCESS'; diff --git a/src/actions/filters.ts b/src/actions/filters.ts index fe7026876..cec439816 100644 --- a/src/actions/filters.ts +++ b/src/actions/filters.ts @@ -1,12 +1,12 @@ import { defineMessages } from 'react-intl'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const FILTERS_FETCH_REQUEST = 'FILTERS_FETCH_REQUEST'; const FILTERS_FETCH_SUCCESS = 'FILTERS_FETCH_SUCCESS'; diff --git a/src/actions/groups.ts b/src/actions/groups.ts index 4fdb6c7d6..0b11d8c58 100644 --- a/src/actions/groups.ts +++ b/src/actions/groups.ts @@ -1,13 +1,13 @@ -import { deleteEntities } from 'soapbox/entity-store/actions'; +import { deleteEntities } from 'soapbox/entity-store/actions.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedGroups, importFetchedAccounts } from './importer'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedGroups, importFetchedAccounts } from './importer/index.ts'; -import type { GroupRole } from 'soapbox/reducers/group-memberships'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { GroupRole } from 'soapbox/reducers/group-memberships.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const GROUP_CREATE_REQUEST = 'GROUP_CREATE_REQUEST'; const GROUP_CREATE_SUCCESS = 'GROUP_CREATE_SUCCESS'; diff --git a/src/actions/history.ts b/src/actions/history.ts index cf975cf42..95f71a929 100644 --- a/src/actions/history.ts +++ b/src/actions/history.ts @@ -1,9 +1,9 @@ -import api from 'soapbox/api'; +import api from 'soapbox/api/index.ts'; -import { importFetchedAccounts } from './importer'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const HISTORY_FETCH_REQUEST = 'HISTORY_FETCH_REQUEST'; const HISTORY_FETCH_SUCCESS = 'HISTORY_FETCH_SUCCESS'; diff --git a/src/actions/import-data.ts b/src/actions/import-data.ts index c518d1a16..0aa5ebaa4 100644 --- a/src/actions/import-data.ts +++ b/src/actions/import-data.ts @@ -1,10 +1,10 @@ import { defineMessages } from 'react-intl'; -import toast from 'soapbox/toast'; +import toast from 'soapbox/toast.tsx'; -import api from '../api'; +import api from '../api/index.ts'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; export const IMPORT_FOLLOWS_REQUEST = 'IMPORT_FOLLOWS_REQUEST'; export const IMPORT_FOLLOWS_SUCCESS = 'IMPORT_FOLLOWS_SUCCESS'; diff --git a/src/actions/importer/index.ts b/src/actions/importer/index.ts index 5afb880c0..07bddfaed 100644 --- a/src/actions/importer/index.ts +++ b/src/actions/importer/index.ts @@ -1,12 +1,12 @@ -import { importEntities } from 'soapbox/entity-store/actions'; -import { Entities } from 'soapbox/entity-store/entities'; -import { Group, accountSchema, groupSchema } from 'soapbox/schemas'; -import { filteredArray } from 'soapbox/schemas/utils'; +import { importEntities } from 'soapbox/entity-store/actions.ts'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { Group, accountSchema, groupSchema } from 'soapbox/schemas/index.ts'; +import { filteredArray } from 'soapbox/schemas/utils.ts'; -import { getSettings } from '../settings'; +import { getSettings } from '../settings.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const ACCOUNT_IMPORT = 'ACCOUNT_IMPORT'; const ACCOUNTS_IMPORT = 'ACCOUNTS_IMPORT'; diff --git a/src/actions/instance.ts b/src/actions/instance.ts index dd17af6ef..9adc7bc1d 100644 --- a/src/actions/instance.ts +++ b/src/actions/instance.ts @@ -1,11 +1,11 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; -import { instanceV1Schema, instanceV2Schema } from 'soapbox/schemas/instance'; -import { RootState } from 'soapbox/store'; -import { getAuthUserUrl, getMeUrl } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import { instanceV1Schema, instanceV2Schema } from 'soapbox/schemas/instance.ts'; +import { RootState } from 'soapbox/store.ts'; +import { getAuthUserUrl, getMeUrl } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api from '../api'; +import api from '../api/index.ts'; /** Figure out the appropriate instance to fetch depending on the state */ export const getHost = (state: RootState) => { diff --git a/src/actions/interactions.ts b/src/actions/interactions.ts index b18b8f3a2..86472d35a 100644 --- a/src/actions/interactions.ts +++ b/src/actions/interactions.ts @@ -1,18 +1,18 @@ import { defineMessages } from 'react-intl'; -import toast, { type IToastOptions } from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import toast, { type IToastOptions } from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts, importFetchedStatus } from './importer'; -import { openModal } from './modals'; -import { expandGroupFeaturedTimeline } from './timelines'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts, importFetchedStatus } from './importer/index.ts'; +import { openModal } from './modals.ts'; +import { expandGroupFeaturedTimeline } from './timelines.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { Account as AccountEntity, APIEntity, Group, Status as StatusEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { Account as AccountEntity, APIEntity, Group, Status as StatusEntity } from 'soapbox/types/entities.ts'; const REBLOG_REQUEST = 'REBLOG_REQUEST'; const REBLOG_SUCCESS = 'REBLOG_SUCCESS'; diff --git a/src/actions/lists.ts b/src/actions/lists.ts index e7c6604f9..0df09c068 100644 --- a/src/actions/lists.ts +++ b/src/actions/lists.ts @@ -1,13 +1,13 @@ -import { selectAccount } from 'soapbox/selectors'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { importFetchedAccounts } from './importer'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST'; const LIST_FETCH_SUCCESS = 'LIST_FETCH_SUCCESS'; diff --git a/src/actions/markers.ts b/src/actions/markers.ts index 96ba12349..33dc1f6c4 100644 --- a/src/actions/markers.ts +++ b/src/actions/markers.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const MARKER_FETCH_REQUEST = 'MARKER_FETCH_REQUEST'; const MARKER_FETCH_SUCCESS = 'MARKER_FETCH_SUCCESS'; diff --git a/src/actions/me.ts b/src/actions/me.ts index 2933da913..47641594f 100644 --- a/src/actions/me.ts +++ b/src/actions/me.ts @@ -1,17 +1,17 @@ -import { selectAccount } from 'soapbox/selectors'; -import { setSentryAccount } from 'soapbox/sentry'; -import KVStore from 'soapbox/storage/kv-store'; -import { getAuthUserId, getAuthUserUrl } from 'soapbox/utils/auth'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import { setSentryAccount } from 'soapbox/sentry.ts'; +import KVStore from 'soapbox/storage/kv-store.ts'; +import { getAuthUserId, getAuthUserUrl } from 'soapbox/utils/auth.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { loadCredentials } from './auth'; -import { importFetchedAccount } from './importer'; +import { loadCredentials } from './auth.ts'; +import { importFetchedAccount } from './importer/index.ts'; import type { RawAxiosRequestHeaders } from 'axios'; -import type { Account } from 'soapbox/schemas'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas/index.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const ME_FETCH_REQUEST = 'ME_FETCH_REQUEST' as const; const ME_FETCH_SUCCESS = 'ME_FETCH_SUCCESS' as const; diff --git a/src/actions/media.ts b/src/actions/media.ts index acb48a9e5..f009854c4 100644 --- a/src/actions/media.ts +++ b/src/actions/media.ts @@ -1,15 +1,15 @@ import { defineMessages, type IntlShape } from 'react-intl'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; -import { formatBytes, getVideoDuration } from 'soapbox/utils/media'; -import resizeImage from 'soapbox/utils/resize-image'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; +import { formatBytes, getVideoDuration } from 'soapbox/utils/media.ts'; +import resizeImage from 'soapbox/utils/resize-image.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const messages = defineMessages({ exceededImageSizeLimit: { id: 'upload_error.image_size_limit', defaultMessage: 'Image exceeds the current file size limit ({limit})' }, diff --git a/src/actions/mfa.ts b/src/actions/mfa.ts index e4c51203d..2320e4d37 100644 --- a/src/actions/mfa.ts +++ b/src/actions/mfa.ts @@ -1,6 +1,6 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const MFA_FETCH_REQUEST = 'MFA_FETCH_REQUEST'; const MFA_FETCH_SUCCESS = 'MFA_FETCH_SUCCESS'; diff --git a/src/actions/modals.ts b/src/actions/modals.ts index 20ae13f0a..a1d6af4e8 100644 --- a/src/actions/modals.ts +++ b/src/actions/modals.ts @@ -1,6 +1,6 @@ -import { AppDispatch } from 'soapbox/store'; +import { AppDispatch } from 'soapbox/store.ts'; -import type { ModalType } from 'soapbox/features/ui/components/modal-root'; +import type { ModalType } from 'soapbox/features/ui/components/modal-root.tsx'; export const MODAL_OPEN = 'MODAL_OPEN'; export const MODAL_CLOSE = 'MODAL_CLOSE'; diff --git a/src/actions/moderation.tsx b/src/actions/moderation.tsx index e461fe011..32d61aa38 100644 --- a/src/actions/moderation.tsx +++ b/src/actions/moderation.tsx @@ -4,16 +4,16 @@ import userMinusIcon from '@tabler/icons/outline/user-minus.svg'; import userOffIcon from '@tabler/icons/outline/user-off.svg'; import { defineMessages, IntlShape } from 'react-intl'; -import { fetchAccountByUsername } from 'soapbox/actions/accounts'; -import { deactivateUsers, deleteUser, deleteStatus, toggleStatusSensitivity } from 'soapbox/actions/admin'; -import { openModal } from 'soapbox/actions/modals'; -import OutlineBox from 'soapbox/components/outline-box'; -import { Stack, Text } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account-container'; -import { selectAccount } from 'soapbox/selectors'; -import toast from 'soapbox/toast'; +import { fetchAccountByUsername } from 'soapbox/actions/accounts.ts'; +import { deactivateUsers, deleteUser, deleteStatus, toggleStatusSensitivity } from 'soapbox/actions/admin.ts'; +import { openModal } from 'soapbox/actions/modals.ts'; +import OutlineBox from 'soapbox/components/outline-box.tsx'; +import { Stack, Text } from 'soapbox/components/ui/index.ts'; +import AccountContainer from 'soapbox/containers/account-container.tsx'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import toast from 'soapbox/toast.tsx'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const messages = defineMessages({ deactivateUserHeading: { id: 'confirmations.admin.deactivate_user.heading', defaultMessage: 'Deactivate @{acct}' }, diff --git a/src/actions/mrf.ts b/src/actions/mrf.ts index 509bdb8fc..25e2db720 100644 --- a/src/actions/mrf.ts +++ b/src/actions/mrf.ts @@ -1,11 +1,11 @@ import { Set as ImmutableSet } from 'immutable'; -import ConfigDB from 'soapbox/utils/config-db'; +import ConfigDB from 'soapbox/utils/config-db.ts'; -import { fetchConfig, updateConfig } from './admin'; +import { fetchConfig, updateConfig } from './admin.ts'; -import type { MRFSimple } from 'soapbox/schemas/pleroma'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { MRFSimple } from 'soapbox/schemas/pleroma.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const simplePolicyMerge = (simplePolicy: MRFSimple, host: string, restrictions: Record) => { const entries = Object.entries(simplePolicy).map(([key, hosts]) => { diff --git a/src/actions/mutes.ts b/src/actions/mutes.ts index 205ee4677..350fd93e8 100644 --- a/src/actions/mutes.ts +++ b/src/actions/mutes.ts @@ -1,8 +1,8 @@ -import { openModal } from './modals'; +import { openModal } from './modals.ts'; -import type { Account } from 'soapbox/schemas'; -import type { AppDispatch } from 'soapbox/store'; -import type { Account as AccountEntity } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas/index.ts'; +import type { AppDispatch } from 'soapbox/store.ts'; +import type { Account as AccountEntity } from 'soapbox/types/entities.ts'; const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL'; const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS'; diff --git a/src/actions/nostr.ts b/src/actions/nostr.ts index 97fbb2af8..c6d7c944d 100644 --- a/src/actions/nostr.ts +++ b/src/actions/nostr.ts @@ -1,13 +1,13 @@ import { NostrSigner, NRelay1, NSecSigner } from '@nostrify/nostrify'; import { generateSecretKey } from 'nostr-tools'; -import { NBunker } from 'soapbox/features/nostr/NBunker'; -import { keyring } from 'soapbox/features/nostr/keyring'; -import { useBunkerStore } from 'soapbox/hooks/nostr/useBunkerStore'; -import { type AppDispatch } from 'soapbox/store'; +import { NBunker } from 'soapbox/features/nostr/NBunker.ts'; +import { keyring } from 'soapbox/features/nostr/keyring.ts'; +import { useBunkerStore } from 'soapbox/hooks/nostr/useBunkerStore.ts'; +import { type AppDispatch } from 'soapbox/store.ts'; -import { authLoggedIn, verifyCredentials } from './auth'; -import { obtainOAuthToken } from './oauth'; +import { authLoggedIn, verifyCredentials } from './auth.ts'; +import { obtainOAuthToken } from './oauth.ts'; const NOSTR_PUBKEY_SET = 'NOSTR_PUBKEY_SET'; diff --git a/src/actions/notifications.test.ts b/src/actions/notifications.test.ts index 44ce0cb9f..1f67081dd 100644 --- a/src/actions/notifications.test.ts +++ b/src/actions/notifications.test.ts @@ -1,11 +1,11 @@ import { OrderedMap as ImmutableOrderedMap } from 'immutable'; import { describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { normalizeNotification } from 'soapbox/normalizers'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeNotification } from 'soapbox/normalizers/index.ts'; -import { markReadNotifications } from './notifications'; +import { markReadNotifications } from './notifications.ts'; describe('markReadNotifications()', () => { it('fires off marker when top notification is newer than lastRead', async() => { diff --git a/src/actions/notifications.ts b/src/actions/notifications.ts index c6ce8043a..6ecf8023b 100644 --- a/src/actions/notifications.ts +++ b/src/actions/notifications.ts @@ -2,28 +2,28 @@ import IntlMessageFormat from 'intl-messageformat'; import 'intl-pluralrules'; import { defineMessages } from 'react-intl'; -import api, { getLinks } from 'soapbox/api'; -import { getFilters, regexFromFilters } from 'soapbox/selectors'; -import { isLoggedIn } from 'soapbox/utils/auth'; -import { compareId } from 'soapbox/utils/comparators'; -import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; -import { unescapeHTML } from 'soapbox/utils/html'; -import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification'; -import { joinPublicPath } from 'soapbox/utils/static'; +import api, { getLinks } from 'soapbox/api/index.ts'; +import { getFilters, regexFromFilters } from 'soapbox/selectors/index.ts'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { compareId } from 'soapbox/utils/comparators.ts'; +import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features.ts'; +import { unescapeHTML } from 'soapbox/utils/html.ts'; +import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification.ts'; +import { joinPublicPath } from 'soapbox/utils/static.ts'; -import { fetchRelationships } from './accounts'; -import { fetchGroupRelationships } from './groups'; +import { fetchRelationships } from './accounts.ts'; +import { fetchGroupRelationships } from './groups.ts'; import { importFetchedAccount, importFetchedAccounts, importFetchedStatus, importFetchedStatuses, -} from './importer'; -import { saveMarker } from './markers'; -import { getSettings, saveSettings } from './settings'; +} from './importer/index.ts'; +import { saveMarker } from './markers.ts'; +import { getSettings, saveSettings } from './settings.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status } from 'soapbox/types/entities.ts'; const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; diff --git a/src/actions/oauth.ts b/src/actions/oauth.ts index 4147c9409..10b5c1076 100644 --- a/src/actions/oauth.ts +++ b/src/actions/oauth.ts @@ -6,11 +6,11 @@ * @see module:soapbox/actions/auth */ -import { getBaseURL } from 'soapbox/utils/state'; +import { getBaseURL } from 'soapbox/utils/state.ts'; -import { baseClient } from '../api'; +import { baseClient } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; export const OAUTH_TOKEN_CREATE_REQUEST = 'OAUTH_TOKEN_CREATE_REQUEST'; export const OAUTH_TOKEN_CREATE_SUCCESS = 'OAUTH_TOKEN_CREATE_SUCCESS'; diff --git a/src/actions/onboarding.test.ts b/src/actions/onboarding.test.ts index 7d2fcdb26..c52877695 100644 --- a/src/actions/onboarding.test.ts +++ b/src/actions/onboarding.test.ts @@ -1,8 +1,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers'; +import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers.tsx'; -import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding'; +import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding.ts'; describe('checkOnboarding()', () => { let mockGetItem: any; diff --git a/src/actions/patron.ts b/src/actions/patron.ts index 0e164462f..4a3d5eade 100644 --- a/src/actions/patron.ts +++ b/src/actions/patron.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const PATRON_INSTANCE_FETCH_REQUEST = 'PATRON_INSTANCE_FETCH_REQUEST'; const PATRON_INSTANCE_FETCH_SUCCESS = 'PATRON_INSTANCE_FETCH_SUCCESS'; diff --git a/src/actions/pin-statuses.ts b/src/actions/pin-statuses.ts index c2a5115cd..a09a71fa9 100644 --- a/src/actions/pin-statuses.ts +++ b/src/actions/pin-statuses.ts @@ -1,11 +1,11 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { importFetchedStatuses } from './importer'; +import { importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST'; const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS'; diff --git a/src/actions/polls.ts b/src/actions/polls.ts index 64fb65320..57a83e08e 100644 --- a/src/actions/polls.ts +++ b/src/actions/polls.ts @@ -1,9 +1,9 @@ -import api from '../api'; +import api from '../api/index.ts'; -import { importFetchedPoll } from './importer'; +import { importFetchedPoll } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const POLL_VOTE_REQUEST = 'POLL_VOTE_REQUEST'; const POLL_VOTE_SUCCESS = 'POLL_VOTE_SUCCESS'; diff --git a/src/actions/preload.test.ts b/src/actions/preload.test.ts index 96cd9bbf6..2ecf454e1 100644 --- a/src/actions/preload.test.ts +++ b/src/actions/preload.test.ts @@ -1,14 +1,14 @@ import { describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore } from 'soapbox/jest/test-helpers'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore } from 'soapbox/jest/test-helpers.tsx'; -import { VERIFY_CREDENTIALS_REQUEST } from './auth'; -import { ACCOUNTS_IMPORT } from './importer'; +import { VERIFY_CREDENTIALS_REQUEST } from './auth.ts'; +import { ACCOUNTS_IMPORT } from './importer/index.ts'; import { MASTODON_PRELOAD_IMPORT, preloadMastodon, -} from './preload'; +} from './preload.ts'; describe('preloadMastodon()', () => { it('creates the expected actions', async () => { diff --git a/src/actions/preload.ts b/src/actions/preload.ts index 07b0aa0bb..f923b467f 100644 --- a/src/actions/preload.ts +++ b/src/actions/preload.ts @@ -1,9 +1,9 @@ import mapValues from 'lodash/mapValues'; -import { verifyCredentials } from './auth'; -import { importFetchedAccounts } from './importer'; +import { verifyCredentials } from './auth.ts'; +import { importFetchedAccounts } from './importer/index.ts'; -import type { AppDispatch } from 'soapbox/store'; +import type { AppDispatch } from 'soapbox/store.ts'; const PLEROMA_PRELOAD_IMPORT = 'PLEROMA_PRELOAD_IMPORT'; const MASTODON_PRELOAD_IMPORT = 'MASTODON_PRELOAD_IMPORT'; diff --git a/src/actions/push-notifications/registerer.ts b/src/actions/push-notifications/registerer.ts index f3e4d4a6f..a6983718d 100644 --- a/src/actions/push-notifications/registerer.ts +++ b/src/actions/push-notifications/registerer.ts @@ -1,8 +1,8 @@ /* eslint-disable compat/compat */ -import { HTTPError } from 'soapbox/api/HTTPError'; -import { MastodonClient } from 'soapbox/api/MastodonClient'; -import { WebPushSubscription, webPushSubscriptionSchema } from 'soapbox/schemas/web-push'; -import { decodeBase64Url } from 'soapbox/utils/base64'; +import { HTTPError } from 'soapbox/api/HTTPError.ts'; +import { MastodonClient } from 'soapbox/api/MastodonClient.ts'; +import { WebPushSubscription, webPushSubscriptionSchema } from 'soapbox/schemas/web-push.ts'; +import { decodeBase64Url } from 'soapbox/utils/base64.ts'; // Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' in window && 'getKey' in PushSubscription.prototype); diff --git a/src/actions/remote-timeline.ts b/src/actions/remote-timeline.ts index ac1277aec..0f2640a89 100644 --- a/src/actions/remote-timeline.ts +++ b/src/actions/remote-timeline.ts @@ -1,7 +1,7 @@ -import { getSettings, changeSetting } from 'soapbox/actions/settings'; +import { getSettings, changeSetting } from 'soapbox/actions/settings.ts'; import type { List as ImmutableList, OrderedSet as ImmutableOrderedSet } from 'immutable'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const getPinnedHosts = (state: RootState) => { const settings = getSettings(state); diff --git a/src/actions/reports.ts b/src/actions/reports.ts index 662b24b3d..5a98d0881 100644 --- a/src/actions/reports.ts +++ b/src/actions/reports.ts @@ -1,10 +1,10 @@ -import api from '../api'; +import api from '../api/index.ts'; -import { openModal } from './modals'; +import { openModal } from './modals.ts'; -import type { Account } from 'soapbox/schemas'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { ChatMessage, Group, Status } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas/index.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { ChatMessage, Group, Status } from 'soapbox/types/entities.ts'; const REPORT_INIT = 'REPORT_INIT'; const REPORT_CANCEL = 'REPORT_CANCEL'; diff --git a/src/actions/scheduled-statuses.ts b/src/actions/scheduled-statuses.ts index b7cf112e9..7bd8d0331 100644 --- a/src/actions/scheduled-statuses.ts +++ b/src/actions/scheduled-statuses.ts @@ -1,9 +1,9 @@ -import { getFeatures } from 'soapbox/utils/features'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const SCHEDULED_STATUSES_FETCH_REQUEST = 'SCHEDULED_STATUSES_FETCH_REQUEST'; const SCHEDULED_STATUSES_FETCH_SUCCESS = 'SCHEDULED_STATUSES_FETCH_SUCCESS'; diff --git a/src/actions/search.ts b/src/actions/search.ts index 8810605eb..82a96c009 100644 --- a/src/actions/search.ts +++ b/src/actions/search.ts @@ -1,11 +1,11 @@ -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts, importFetchedStatuses } from './importer'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts, importFetchedStatuses } from './importer/index.ts'; -import type { SearchFilter } from 'soapbox/reducers/search'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { SearchFilter } from 'soapbox/reducers/search.ts'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const SEARCH_CHANGE = 'SEARCH_CHANGE'; const SEARCH_CLEAR = 'SEARCH_CLEAR'; diff --git a/src/actions/security.ts b/src/actions/security.ts index 4448104b7..683a3a6e6 100644 --- a/src/actions/security.ts +++ b/src/actions/security.ts @@ -4,16 +4,16 @@ * @see module:soapbox/actions/auth */ -import toast from 'soapbox/toast'; -import { getLoggedInAccount } from 'soapbox/utils/auth'; -import { parseVersion, TRUTHSOCIAL } from 'soapbox/utils/features'; -import { normalizeUsername } from 'soapbox/utils/input'; +import toast from 'soapbox/toast.tsx'; +import { getLoggedInAccount } from 'soapbox/utils/auth.ts'; +import { parseVersion, TRUTHSOCIAL } from 'soapbox/utils/features.ts'; +import { normalizeUsername } from 'soapbox/utils/input.ts'; -import api from '../api'; +import api from '../api/index.ts'; -import { AUTH_LOGGED_OUT, messages } from './auth'; +import { AUTH_LOGGED_OUT, messages } from './auth.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const FETCH_TOKENS_REQUEST = 'FETCH_TOKENS_REQUEST'; const FETCH_TOKENS_SUCCESS = 'FETCH_TOKENS_SUCCESS'; diff --git a/src/actions/settings.ts b/src/actions/settings.ts index e05771fdc..50204e0f4 100644 --- a/src/actions/settings.ts +++ b/src/actions/settings.ts @@ -2,12 +2,12 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable'; import { defineMessage } from 'react-intl'; import { createSelector } from 'reselect'; -import { patchMe } from 'soapbox/actions/me'; -import messages from 'soapbox/messages'; -import toast from 'soapbox/toast'; -import { isLoggedIn } from 'soapbox/utils/auth'; +import { patchMe } from 'soapbox/actions/me.ts'; +import messages from 'soapbox/messages.ts'; +import toast from 'soapbox/toast.tsx'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const SETTING_CHANGE = 'SETTING_CHANGE' as const; const SETTING_SAVE = 'SETTING_SAVE' as const; diff --git a/src/actions/soapbox.ts b/src/actions/soapbox.ts index 44552e38e..31e7679b1 100644 --- a/src/actions/soapbox.ts +++ b/src/actions/soapbox.ts @@ -1,15 +1,15 @@ import { createSelector } from 'reselect'; -import { getHost } from 'soapbox/actions/instance'; -import { normalizeSoapboxConfig } from 'soapbox/normalizers'; -import KVStore from 'soapbox/storage/kv-store'; -import { removeVS16s } from 'soapbox/utils/emoji'; -import { getFeatures } from 'soapbox/utils/features'; +import { getHost } from 'soapbox/actions/instance.ts'; +import { normalizeSoapboxConfig } from 'soapbox/normalizers/index.ts'; +import KVStore from 'soapbox/storage/kv-store.ts'; +import { removeVS16s } from 'soapbox/utils/emoji.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { staticClient } from '../api'; +import api, { staticClient } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const SOAPBOX_CONFIG_REQUEST_SUCCESS = 'SOAPBOX_CONFIG_REQUEST_SUCCESS'; const SOAPBOX_CONFIG_REQUEST_FAIL = 'SOAPBOX_CONFIG_REQUEST_FAIL'; diff --git a/src/actions/status-quotes.test.ts b/src/actions/status-quotes.test.ts index ca7d4f764..b11085fec 100644 --- a/src/actions/status-quotes.test.ts +++ b/src/actions/status-quotes.test.ts @@ -1,11 +1,11 @@ import { Map as ImmutableMap } from 'immutable'; import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { StatusListRecord } from 'soapbox/reducers/status-lists'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { StatusListRecord } from 'soapbox/reducers/status-lists.ts'; -import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes'; +import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes.ts'; const status = { account: { diff --git a/src/actions/status-quotes.ts b/src/actions/status-quotes.ts index 9dab8df46..2bb83a721 100644 --- a/src/actions/status-quotes.ts +++ b/src/actions/status-quotes.ts @@ -1,8 +1,8 @@ -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { importFetchedStatuses } from './importer'; +import { importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; export const STATUS_QUOTES_FETCH_REQUEST = 'STATUS_QUOTES_FETCH_REQUEST'; export const STATUS_QUOTES_FETCH_SUCCESS = 'STATUS_QUOTES_FETCH_SUCCESS'; diff --git a/src/actions/statuses.test.ts b/src/actions/statuses.test.ts index 3c72ef7ab..641b9d48d 100644 --- a/src/actions/statuses.test.ts +++ b/src/actions/statuses.test.ts @@ -1,12 +1,12 @@ import { fromJS, Map as ImmutableMap } from 'immutable'; import { beforeEach, describe, expect, it } from 'vitest'; -import { STATUSES_IMPORT } from 'soapbox/actions/importer'; -import { __stub } from 'soapbox/api'; -import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { normalizeStatus } from 'soapbox/normalizers/status'; +import { STATUSES_IMPORT } from 'soapbox/actions/importer/index.ts'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeStatus } from 'soapbox/normalizers/status.ts'; -import { deleteStatus, fetchContext } from './statuses'; +import { deleteStatus, fetchContext } from './statuses.ts'; describe('fetchContext()', () => { it('handles Mitra context', async () => { diff --git a/src/actions/statuses.ts b/src/actions/statuses.ts index db1bfdb47..8d00cf00b 100644 --- a/src/actions/statuses.ts +++ b/src/actions/statuses.ts @@ -1,17 +1,17 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; -import { shouldHaveCard } from 'soapbox/utils/status'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; +import { shouldHaveCard } from 'soapbox/utils/status.ts'; -import api, { getNextLink } from '../api'; +import api, { getNextLink } from '../api/index.ts'; -import { setComposeToStatus } from './compose-status'; -import { fetchGroupRelationships } from './groups'; -import { importFetchedStatus, importFetchedStatuses } from './importer'; -import { openModal } from './modals'; -import { deleteFromTimelines } from './timelines'; +import { setComposeToStatus } from './compose-status.ts'; +import { fetchGroupRelationships } from './groups.ts'; +import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts'; +import { openModal } from './modals.ts'; +import { deleteFromTimelines } from './timelines.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status } from 'soapbox/types/entities.ts'; const STATUS_CREATE_REQUEST = 'STATUS_CREATE_REQUEST'; const STATUS_CREATE_SUCCESS = 'STATUS_CREATE_SUCCESS'; diff --git a/src/actions/streaming.ts b/src/actions/streaming.ts index 925832265..23b426cd8 100644 --- a/src/actions/streaming.ts +++ b/src/actions/streaming.ts @@ -1,33 +1,33 @@ -import { getLocale, getSettings } from 'soapbox/actions/settings'; -import { updateReactions } from 'soapbox/api/hooks/announcements/useAnnouncements'; -import { importEntities } from 'soapbox/entity-store/actions'; -import { Entities } from 'soapbox/entity-store/entities'; -import { selectEntity } from 'soapbox/entity-store/selectors'; -import messages from 'soapbox/messages'; -import { ChatKeys, IChat, isLastMessage } from 'soapbox/queries/chats'; -import { queryClient } from 'soapbox/queries/client'; -import { announcementSchema, type Announcement, type Relationship } from 'soapbox/schemas'; -import { getUnreadChatsCount, updateChatListItem, updateChatMessage } from 'soapbox/utils/chats'; -import { removePageItem } from 'soapbox/utils/queries'; -import { play, soundCache } from 'soapbox/utils/sounds'; +import { getLocale, getSettings } from 'soapbox/actions/settings.ts'; +import { updateReactions } from 'soapbox/api/hooks/announcements/useAnnouncements.ts'; +import { importEntities } from 'soapbox/entity-store/actions.ts'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { selectEntity } from 'soapbox/entity-store/selectors.ts'; +import messages from 'soapbox/messages.ts'; +import { ChatKeys, IChat, isLastMessage } from 'soapbox/queries/chats.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { announcementSchema, type Announcement, type Relationship } from 'soapbox/schemas/index.ts'; +import { getUnreadChatsCount, updateChatListItem, updateChatMessage } from 'soapbox/utils/chats.ts'; +import { removePageItem } from 'soapbox/utils/queries.ts'; +import { play, soundCache } from 'soapbox/utils/sounds.ts'; -import { connectStream } from '../stream'; +import { connectStream } from '../stream.ts'; -import { updateConversations } from './conversations'; -import { fetchFilters } from './filters'; -import { MARKER_FETCH_SUCCESS } from './markers'; -import { updateNotificationsQueue } from './notifications'; -import { updateStatus } from './statuses'; +import { updateConversations } from './conversations.ts'; +import { fetchFilters } from './filters.ts'; +import { MARKER_FETCH_SUCCESS } from './markers.ts'; +import { updateNotificationsQueue } from './notifications.ts'; +import { updateStatus } from './statuses.ts'; import { // deleteFromTimelines, connectTimeline, disconnectTimeline, processTimelineUpdate, -} from './timelines'; +} from './timelines.ts'; -import type { IStatContext } from 'soapbox/contexts/stat-context'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Chat } from 'soapbox/types/entities'; +import type { IStatContext } from 'soapbox/contexts/stat-context.tsx'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Chat } from 'soapbox/types/entities.ts'; const STREAMING_CHAT_UPDATE = 'STREAMING_CHAT_UPDATE'; diff --git a/src/actions/suggestions.ts b/src/actions/suggestions.ts index 4c2584856..5065100b6 100644 --- a/src/actions/suggestions.ts +++ b/src/actions/suggestions.ts @@ -1,14 +1,14 @@ -import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures } from 'soapbox/utils/features'; +import { isLoggedIn } from 'soapbox/utils/auth.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { fetchRelationships } from './accounts'; -import { importFetchedAccounts } from './importer'; -import { insertSuggestionsIntoTimeline } from './timelines'; +import { fetchRelationships } from './accounts.ts'; +import { importFetchedAccounts } from './importer/index.ts'; +import { insertSuggestionsIntoTimeline } from './timelines.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const SUGGESTIONS_FETCH_REQUEST = 'SUGGESTIONS_FETCH_REQUEST'; const SUGGESTIONS_FETCH_SUCCESS = 'SUGGESTIONS_FETCH_SUCCESS'; diff --git a/src/actions/tags.ts b/src/actions/tags.ts index ee3289570..3873bc329 100644 --- a/src/actions/tags.ts +++ b/src/actions/tags.ts @@ -1,7 +1,7 @@ -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const HASHTAG_FETCH_REQUEST = 'HASHTAG_FETCH_REQUEST'; const HASHTAG_FETCH_SUCCESS = 'HASHTAG_FETCH_SUCCESS'; diff --git a/src/actions/timelines.ts b/src/actions/timelines.ts index a6cd2b139..4b7aa6ce1 100644 --- a/src/actions/timelines.ts +++ b/src/actions/timelines.ts @@ -1,16 +1,16 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable'; -import { getSettings } from 'soapbox/actions/settings'; -import { normalizeStatus } from 'soapbox/normalizers'; -import { shouldFilter } from 'soapbox/utils/timelines'; +import { getSettings } from 'soapbox/actions/settings.ts'; +import { normalizeStatus } from 'soapbox/normalizers/index.ts'; +import { shouldFilter } from 'soapbox/utils/timelines.ts'; -import api, { getNextLink, getPrevLink } from '../api'; +import api, { getNextLink, getPrevLink } from '../api/index.ts'; -import { fetchGroupRelationships } from './groups'; -import { importFetchedStatus, importFetchedStatuses } from './importer'; +import { fetchGroupRelationships } from './groups.ts'; +import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity, Status } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity, Status } from 'soapbox/types/entities.ts'; const TIMELINE_UPDATE = 'TIMELINE_UPDATE' as const; const TIMELINE_DELETE = 'TIMELINE_DELETE' as const; diff --git a/src/actions/trending-statuses.ts b/src/actions/trending-statuses.ts index c6a26e316..e0075b019 100644 --- a/src/actions/trending-statuses.ts +++ b/src/actions/trending-statuses.ts @@ -1,11 +1,11 @@ -import { APIEntity } from 'soapbox/types/entities'; -import { getFeatures } from 'soapbox/utils/features'; +import { APIEntity } from 'soapbox/types/entities.ts'; +import { getFeatures } from 'soapbox/utils/features.ts'; -import api, { getLinks } from '../api'; +import api, { getLinks } from '../api/index.ts'; -import { importFetchedStatuses } from './importer'; +import { importFetchedStatuses } from './importer/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; const TRENDING_STATUSES_FETCH_REQUEST = 'TRENDING_STATUSES_FETCH_REQUEST'; const TRENDING_STATUSES_FETCH_SUCCESS = 'TRENDING_STATUSES_FETCH_SUCCESS'; diff --git a/src/actions/trends.ts b/src/actions/trends.ts index 6eeb32c38..f13e063cf 100644 --- a/src/actions/trends.ts +++ b/src/actions/trends.ts @@ -1,7 +1,7 @@ -import api from '../api'; +import api from '../api/index.ts'; -import type { AppDispatch, RootState } from 'soapbox/store'; -import type { APIEntity } from 'soapbox/types/entities'; +import type { AppDispatch, RootState } from 'soapbox/store.ts'; +import type { APIEntity } from 'soapbox/types/entities.ts'; const TRENDS_FETCH_REQUEST = 'TRENDS_FETCH_REQUEST'; const TRENDS_FETCH_SUCCESS = 'TRENDS_FETCH_SUCCESS'; diff --git a/src/api/MastodonClient.ts b/src/api/MastodonClient.ts index 42263d517..a0d084349 100644 --- a/src/api/MastodonClient.ts +++ b/src/api/MastodonClient.ts @@ -1,4 +1,4 @@ -import { HTTPError } from './HTTPError'; +import { HTTPError } from './HTTPError.ts'; interface Opts { searchParams?: URLSearchParams | Record; diff --git a/src/api/hooks/accounts/useAccount.ts b/src/api/hooks/accounts/useAccount.ts index 9db7ec217..5876e3fc5 100644 --- a/src/api/hooks/accounts/useAccount.ts +++ b/src/api/hooks/accounts/useAccount.ts @@ -1,12 +1,12 @@ import { useEffect, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks'; -import { type Account, accountSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks/index.ts'; +import { type Account, accountSchema } from 'soapbox/schemas/index.ts'; -import { useRelationship } from './useRelationship'; +import { useRelationship } from './useRelationship.ts'; interface UseAccountOpts { withRelationship?: boolean; diff --git a/src/api/hooks/accounts/useAccountList.ts b/src/api/hooks/accounts/useAccountList.ts index ec769224b..541227b1f 100644 --- a/src/api/hooks/accounts/useAccountList.ts +++ b/src/api/hooks/accounts/useAccountList.ts @@ -1,11 +1,11 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { Account, accountSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { Account, accountSchema } from 'soapbox/schemas/index.ts'; -import { useRelationships } from './useRelationships'; +import { useRelationships } from './useRelationships.ts'; -import type { EntityFn } from 'soapbox/entity-store/hooks/types'; +import type { EntityFn } from 'soapbox/entity-store/hooks/types.ts'; interface useAccountListOpts { enabled?: boolean; diff --git a/src/api/hooks/accounts/useAccountLookup.ts b/src/api/hooks/accounts/useAccountLookup.ts index ef9306a7d..d317147cc 100644 --- a/src/api/hooks/accounts/useAccountLookup.ts +++ b/src/api/hooks/accounts/useAccountLookup.ts @@ -1,12 +1,12 @@ import { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityLookup } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks'; -import { type Account, accountSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityLookup } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks/index.ts'; +import { type Account, accountSchema } from 'soapbox/schemas/index.ts'; -import { useRelationship } from './useRelationship'; +import { useRelationship } from './useRelationship.ts'; interface UseAccountLookupOpts { withRelationship?: boolean; diff --git a/src/api/hooks/accounts/useFollow.ts b/src/api/hooks/accounts/useFollow.ts index 25be4b3bc..142f73d8b 100644 --- a/src/api/hooks/accounts/useFollow.ts +++ b/src/api/hooks/accounts/useFollow.ts @@ -1,8 +1,8 @@ -import { importEntities } from 'soapbox/entity-store/actions'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useTransaction } from 'soapbox/entity-store/hooks'; -import { useApi, useAppDispatch, useLoggedIn } from 'soapbox/hooks'; -import { relationshipSchema } from 'soapbox/schemas'; +import { importEntities } from 'soapbox/entity-store/actions.ts'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useTransaction } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useAppDispatch, useLoggedIn } from 'soapbox/hooks/index.ts'; +import { relationshipSchema } from 'soapbox/schemas/index.ts'; interface FollowOpts { reblogs?: boolean; diff --git a/src/api/hooks/accounts/usePatronUser.ts b/src/api/hooks/accounts/usePatronUser.ts index 27ff6edfe..9ccfe8b84 100644 --- a/src/api/hooks/accounts/usePatronUser.ts +++ b/src/api/hooks/accounts/usePatronUser.ts @@ -1,8 +1,8 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig'; -import { type PatronUser, patronUserSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig.ts'; +import { type PatronUser, patronUserSchema } from 'soapbox/schemas/index.ts'; function usePatronUser(url?: string) { const api = useApi(); diff --git a/src/api/hooks/accounts/useRelationship.ts b/src/api/hooks/accounts/useRelationship.ts index 6424a2876..d76446258 100644 --- a/src/api/hooks/accounts/useRelationship.ts +++ b/src/api/hooks/accounts/useRelationship.ts @@ -1,9 +1,9 @@ import { z } from 'zod'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { type Relationship, relationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { type Relationship, relationshipSchema } from 'soapbox/schemas/index.ts'; interface UseRelationshipOpts { enabled?: boolean; diff --git a/src/api/hooks/accounts/useRelationships.ts b/src/api/hooks/accounts/useRelationships.ts index 8ffdb46ef..a88508a9c 100644 --- a/src/api/hooks/accounts/useRelationships.ts +++ b/src/api/hooks/accounts/useRelationships.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities'; -import { useApi, useLoggedIn } from 'soapbox/hooks'; -import { type Relationship, relationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities.ts'; +import { useApi, useLoggedIn } from 'soapbox/hooks/index.ts'; +import { type Relationship, relationshipSchema } from 'soapbox/schemas/index.ts'; function useRelationships(listKey: string[], ids: string[]) { const api = useApi(); diff --git a/src/api/hooks/admin/index.ts b/src/api/hooks/admin/index.ts index 0ca5e7514..472cdc86e 100644 --- a/src/api/hooks/admin/index.ts +++ b/src/api/hooks/admin/index.ts @@ -1,6 +1,6 @@ -export { useDomains } from './useDomains'; -export { useModerationLog } from './useModerationLog'; -export { useRelays } from './useRelays'; -export { useRules } from './useRules'; -export { useSuggest } from './useSuggest'; -export { useVerify } from './useVerify'; \ No newline at end of file +export { useDomains } from './useDomains.ts'; +export { useModerationLog } from './useModerationLog.ts'; +export { useRelays } from './useRelays.ts'; +export { useRules } from './useRules.ts'; +export { useSuggest } from './useSuggest.ts'; +export { useVerify } from './useVerify.ts'; \ No newline at end of file diff --git a/src/api/hooks/admin/useAdminAccounts.ts b/src/api/hooks/admin/useAdminAccounts.ts index 585a16710..59b0c040f 100644 --- a/src/api/hooks/admin/useAdminAccounts.ts +++ b/src/api/hooks/admin/useAdminAccounts.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { adminAccountSchema } from 'soapbox/schemas/admin-account'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { adminAccountSchema } from 'soapbox/schemas/admin-account.ts'; interface MastodonAdminFilters { local?: boolean; diff --git a/src/api/hooks/admin/useAnnouncements.ts b/src/api/hooks/admin/useAnnouncements.ts index 2fa3f0029..049800655 100644 --- a/src/api/hooks/admin/useAnnouncements.ts +++ b/src/api/hooks/admin/useAnnouncements.ts @@ -1,10 +1,10 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { queryClient } from 'soapbox/queries/client'; -import { adminAnnouncementSchema, type AdminAnnouncement } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { adminAnnouncementSchema, type AdminAnnouncement } from 'soapbox/schemas/index.ts'; -import { useAnnouncements as useUserAnnouncements } from '../announcements'; +import { useAnnouncements as useUserAnnouncements } from '../announcements/index.ts'; interface CreateAnnouncementParams { content: string; diff --git a/src/api/hooks/admin/useCreateDomain.ts b/src/api/hooks/admin/useCreateDomain.ts index 8cbb4ae85..c07f49619 100644 --- a/src/api/hooks/admin/useCreateDomain.ts +++ b/src/api/hooks/admin/useCreateDomain.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { domainSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { domainSchema } from 'soapbox/schemas/index.ts'; interface CreateDomainParams { domain: string; diff --git a/src/api/hooks/admin/useDeleteDomain.ts b/src/api/hooks/admin/useDeleteDomain.ts index 05aeb70e8..85ad41c8e 100644 --- a/src/api/hooks/admin/useDeleteDomain.ts +++ b/src/api/hooks/admin/useDeleteDomain.ts @@ -1,6 +1,6 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useDeleteEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useDeleteEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; const useDeleteDomain = () => { const api = useApi(); diff --git a/src/api/hooks/admin/useDomains.ts b/src/api/hooks/admin/useDomains.ts index ff052b7ac..167e8d398 100644 --- a/src/api/hooks/admin/useDomains.ts +++ b/src/api/hooks/admin/useDomains.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { queryClient } from 'soapbox/queries/client'; -import { domainSchema, type Domain } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { domainSchema, type Domain } from 'soapbox/schemas/index.ts'; interface CreateDomainParams { domain: string; diff --git a/src/api/hooks/admin/useManageZapSplit.ts b/src/api/hooks/admin/useManageZapSplit.ts index e0e0344ce..e6a8420f6 100644 --- a/src/api/hooks/admin/useManageZapSplit.ts +++ b/src/api/hooks/admin/useManageZapSplit.ts @@ -1,10 +1,10 @@ import { useState, useEffect } from 'react'; import { defineMessages } from 'react-intl'; -import { type INewAccount } from 'soapbox/features/admin/manage-zap-split'; -import { useApi } from 'soapbox/hooks'; -import { baseZapAccountSchema, ZapSplitData } from 'soapbox/schemas/zap-split'; -import toast from 'soapbox/toast'; +import { type INewAccount } from 'soapbox/features/admin/manage-zap-split.tsx'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { baseZapAccountSchema, ZapSplitData } from 'soapbox/schemas/zap-split.ts'; +import toast from 'soapbox/toast.tsx'; const messages = defineMessages({ diff --git a/src/api/hooks/admin/useModerationLog.ts b/src/api/hooks/admin/useModerationLog.ts index 2153deab8..9e7c7bc4b 100644 --- a/src/api/hooks/admin/useModerationLog.ts +++ b/src/api/hooks/admin/useModerationLog.ts @@ -1,7 +1,7 @@ import { useInfiniteQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { moderationLogEntrySchema, type ModerationLogEntry } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { moderationLogEntrySchema, type ModerationLogEntry } from 'soapbox/schemas/index.ts'; interface ModerationLogResult { items: ModerationLogEntry[]; diff --git a/src/api/hooks/admin/useRelays.ts b/src/api/hooks/admin/useRelays.ts index d27b6d043..1a1d57099 100644 --- a/src/api/hooks/admin/useRelays.ts +++ b/src/api/hooks/admin/useRelays.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { queryClient } from 'soapbox/queries/client'; -import { relaySchema, type Relay } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { relaySchema, type Relay } from 'soapbox/schemas/index.ts'; const useRelays = () => { const api = useApi(); diff --git a/src/api/hooks/admin/useRules.ts b/src/api/hooks/admin/useRules.ts index 8fed91fa0..c7c1db0c5 100644 --- a/src/api/hooks/admin/useRules.ts +++ b/src/api/hooks/admin/useRules.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { queryClient } from 'soapbox/queries/client'; -import { adminRuleSchema, type AdminRule } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { adminRuleSchema, type AdminRule } from 'soapbox/schemas/index.ts'; interface CreateRuleParams { priority?: number; diff --git a/src/api/hooks/admin/useSuggest.ts b/src/api/hooks/admin/useSuggest.ts index b20bc5308..5358e2771 100644 --- a/src/api/hooks/admin/useSuggest.ts +++ b/src/api/hooks/admin/useSuggest.ts @@ -1,9 +1,9 @@ -import { useTransaction } from 'soapbox/entity-store/hooks'; -import { EntityCallbacks } from 'soapbox/entity-store/hooks/types'; -import { useApi, useGetState } from 'soapbox/hooks'; -import { accountIdsToAccts } from 'soapbox/selectors'; +import { useTransaction } from 'soapbox/entity-store/hooks/index.ts'; +import { EntityCallbacks } from 'soapbox/entity-store/hooks/types.ts'; +import { useApi, useGetState } from 'soapbox/hooks/index.ts'; +import { accountIdsToAccts } from 'soapbox/selectors/index.ts'; -import type { Account } from 'soapbox/schemas'; +import type { Account } from 'soapbox/schemas/index.ts'; function useSuggest() { const api = useApi(); diff --git a/src/api/hooks/admin/useUpdateDomain.ts b/src/api/hooks/admin/useUpdateDomain.ts index 8488d6916..30c639112 100644 --- a/src/api/hooks/admin/useUpdateDomain.ts +++ b/src/api/hooks/admin/useUpdateDomain.ts @@ -1,9 +1,9 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { domainSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { domainSchema } from 'soapbox/schemas/index.ts'; -import type { CreateDomainParams } from './useCreateDomain'; +import type { CreateDomainParams } from './useCreateDomain.ts'; const useUpdateDomain = (id: string) => { const api = useApi(); diff --git a/src/api/hooks/admin/useVerify.ts b/src/api/hooks/admin/useVerify.ts index 9312d609e..ee2da73cb 100644 --- a/src/api/hooks/admin/useVerify.ts +++ b/src/api/hooks/admin/useVerify.ts @@ -1,9 +1,9 @@ -import { useTransaction } from 'soapbox/entity-store/hooks'; -import { EntityCallbacks } from 'soapbox/entity-store/hooks/types'; -import { useApi, useGetState } from 'soapbox/hooks'; -import { accountIdsToAccts } from 'soapbox/selectors'; +import { useTransaction } from 'soapbox/entity-store/hooks/index.ts'; +import { EntityCallbacks } from 'soapbox/entity-store/hooks/types.ts'; +import { useApi, useGetState } from 'soapbox/hooks/index.ts'; +import { accountIdsToAccts } from 'soapbox/selectors/index.ts'; -import type { Account } from 'soapbox/schemas'; +import type { Account } from 'soapbox/schemas/index.ts'; function useVerify() { const api = useApi(); diff --git a/src/api/hooks/announcements/index.ts b/src/api/hooks/announcements/index.ts index 021ac3ea0..ddb8ac3a4 100644 --- a/src/api/hooks/announcements/index.ts +++ b/src/api/hooks/announcements/index.ts @@ -1 +1 @@ -export { useAnnouncements } from './useAnnouncements'; +export { useAnnouncements } from './useAnnouncements.ts'; diff --git a/src/api/hooks/announcements/useAnnouncements.ts b/src/api/hooks/announcements/useAnnouncements.ts index af4e36a2c..1ecbdf8b6 100644 --- a/src/api/hooks/announcements/useAnnouncements.ts +++ b/src/api/hooks/announcements/useAnnouncements.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { queryClient } from 'soapbox/queries/client'; -import { announcementReactionSchema, announcementSchema, type Announcement, type AnnouncementReaction } from 'soapbox/schemas'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { queryClient } from 'soapbox/queries/client.ts'; +import { announcementReactionSchema, announcementSchema, type Announcement, type AnnouncementReaction } from 'soapbox/schemas/index.ts'; const updateReaction = (reaction: AnnouncementReaction, count: number, me?: boolean, overwrite?: boolean) => announcementReactionSchema.parse({ ...reaction, diff --git a/src/api/hooks/captcha/useCaptcha.ts b/src/api/hooks/captcha/useCaptcha.ts index 01b9c9926..a3509dbd5 100644 --- a/src/api/hooks/captcha/useCaptcha.ts +++ b/src/api/hooks/captcha/useCaptcha.ts @@ -2,10 +2,10 @@ import { AxiosError } from 'axios'; import { useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { closeModal } from 'soapbox/actions/modals'; -import { useApi, useAppDispatch, useInstance } from 'soapbox/hooks'; -import { captchaSchema, type CaptchaData } from 'soapbox/schemas/captcha'; -import toast from 'soapbox/toast'; +import { closeModal } from 'soapbox/actions/modals.ts'; +import { useApi, useAppDispatch, useInstance } from 'soapbox/hooks/index.ts'; +import { captchaSchema, type CaptchaData } from 'soapbox/schemas/captcha.ts'; +import toast from 'soapbox/toast.tsx'; diff --git a/src/api/hooks/groups/useBlockGroupMember.ts b/src/api/hooks/groups/useBlockGroupMember.ts index 5155d18c6..1d10b5b5d 100644 --- a/src/api/hooks/groups/useBlockGroupMember.ts +++ b/src/api/hooks/groups/useBlockGroupMember.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; -import type { Account, Group, GroupMember } from 'soapbox/schemas'; +import type { Account, Group, GroupMember } from 'soapbox/schemas/index.ts'; function useBlockGroupMember(group: Group, account: Account) { const { createEntity } = useEntityActions( diff --git a/src/api/hooks/groups/useCancelMembershipRequest.ts b/src/api/hooks/groups/useCancelMembershipRequest.ts index 51c480731..59e2943ce 100644 --- a/src/api/hooks/groups/useCancelMembershipRequest.ts +++ b/src/api/hooks/groups/useCancelMembershipRequest.ts @@ -1,8 +1,8 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi, useOwnAccount } from 'soapbox/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useOwnAccount } from 'soapbox/hooks/index.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useCancelMembershipRequest(group: Group) { const api = useApi(); diff --git a/src/api/hooks/groups/useCreateGroup.ts b/src/api/hooks/groups/useCreateGroup.ts index e80417856..d354a7a27 100644 --- a/src/api/hooks/groups/useCreateGroup.ts +++ b/src/api/hooks/groups/useCreateGroup.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; interface CreateGroupParams { display_name?: string; diff --git a/src/api/hooks/groups/useDeleteGroup.ts b/src/api/hooks/groups/useDeleteGroup.ts index d1b25cccd..b586e3677 100644 --- a/src/api/hooks/groups/useDeleteGroup.ts +++ b/src/api/hooks/groups/useDeleteGroup.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useDeleteGroup() { const { deleteEntity, isSubmitting } = useEntityActions( diff --git a/src/api/hooks/groups/useDeleteGroupStatus.ts b/src/api/hooks/groups/useDeleteGroupStatus.ts index 55a6f9459..ed2d610af 100644 --- a/src/api/hooks/groups/useDeleteGroupStatus.ts +++ b/src/api/hooks/groups/useDeleteGroupStatus.ts @@ -1,8 +1,8 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useDeleteEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useDeleteEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useDeleteGroupStatus(group: Group, statusId: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useDemoteGroupMember.ts b/src/api/hooks/groups/useDemoteGroupMember.ts index db38164b7..3d6a10e85 100644 --- a/src/api/hooks/groups/useDemoteGroupMember.ts +++ b/src/api/hooks/groups/useDemoteGroupMember.ts @@ -1,10 +1,10 @@ import { z } from 'zod'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { groupMemberSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { groupMemberSchema } from 'soapbox/schemas/index.ts'; -import type { Group, GroupMember } from 'soapbox/schemas'; +import type { Group, GroupMember } from 'soapbox/schemas/index.ts'; function useDemoteGroupMember(group: Group, groupMember: GroupMember) { const { createEntity } = useEntityActions( diff --git a/src/api/hooks/groups/useGroup.test.ts b/src/api/hooks/groups/useGroup.test.ts index 4b9c91f56..4212bf7c2 100644 --- a/src/api/hooks/groups/useGroup.test.ts +++ b/src/api/hooks/groups/useGroup.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildGroup } from 'soapbox/jest/factory'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildGroup } from 'soapbox/jest/factory.ts'; +import { renderHook, waitFor } from 'soapbox/jest/test-helpers.tsx'; -import { useGroup } from './useGroup'; +import { useGroup } from './useGroup.ts'; const group = buildGroup({ id: '1', display_name: 'soapbox' }); diff --git a/src/api/hooks/groups/useGroup.ts b/src/api/hooks/groups/useGroup.ts index 9efafb13c..b437936c3 100644 --- a/src/api/hooks/groups/useGroup.ts +++ b/src/api/hooks/groups/useGroup.ts @@ -1,12 +1,12 @@ import { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { type Group, groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { type Group, groupSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationship } from './useGroupRelationship'; +import { useGroupRelationship } from './useGroupRelationship.ts'; function useGroup(groupId: string, refetch = true) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupLookup.test.ts b/src/api/hooks/groups/useGroupLookup.test.ts index 4c7bcbe1f..f000540e5 100644 --- a/src/api/hooks/groups/useGroupLookup.test.ts +++ b/src/api/hooks/groups/useGroupLookup.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildGroup } from 'soapbox/jest/factory'; -import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildGroup } from 'soapbox/jest/factory.ts'; +import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers.tsx'; -import { useGroupLookup } from './useGroupLookup'; +import { useGroupLookup } from './useGroupLookup.ts'; const group = buildGroup({ id: '1', slug: 'soapbox' }); const state = { diff --git a/src/api/hooks/groups/useGroupLookup.ts b/src/api/hooks/groups/useGroupLookup.ts index 8e161af78..f1790c6d2 100644 --- a/src/api/hooks/groups/useGroupLookup.ts +++ b/src/api/hooks/groups/useGroupLookup.ts @@ -1,13 +1,13 @@ import { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityLookup } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { useFeatures } from 'soapbox/hooks/useFeatures'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityLookup } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationship } from './useGroupRelationship'; +import { useGroupRelationship } from './useGroupRelationship.ts'; function useGroupLookup(slug: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupMedia.test.ts b/src/api/hooks/groups/useGroupMedia.test.ts index bbe643c4d..88d9cc281 100644 --- a/src/api/hooks/groups/useGroupMedia.test.ts +++ b/src/api/hooks/groups/useGroupMedia.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildStatus } from 'soapbox/jest/factory'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildStatus } from 'soapbox/jest/factory.ts'; +import { renderHook, waitFor } from 'soapbox/jest/test-helpers.tsx'; -import { useGroupMedia } from './useGroupMedia'; +import { useGroupMedia } from './useGroupMedia.ts'; const status = buildStatus(); const groupId = '1'; diff --git a/src/api/hooks/groups/useGroupMedia.ts b/src/api/hooks/groups/useGroupMedia.ts index 4db7fd179..5c2f6bd88 100644 --- a/src/api/hooks/groups/useGroupMedia.ts +++ b/src/api/hooks/groups/useGroupMedia.ts @@ -1,8 +1,8 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { normalizeStatus } from 'soapbox/normalizers'; -import { toSchema } from 'soapbox/utils/normalizers'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { normalizeStatus } from 'soapbox/normalizers/index.ts'; +import { toSchema } from 'soapbox/utils/normalizers.ts'; const statusSchema = toSchema(normalizeStatus); diff --git a/src/api/hooks/groups/useGroupMembers.test.ts b/src/api/hooks/groups/useGroupMembers.test.ts index 3087bd3fb..02971b2cb 100644 --- a/src/api/hooks/groups/useGroupMembers.test.ts +++ b/src/api/hooks/groups/useGroupMembers.test.ts @@ -1,11 +1,11 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildGroupMember } from 'soapbox/jest/factory'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; -import { GroupRoles } from 'soapbox/schemas/group-member'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildGroupMember } from 'soapbox/jest/factory.ts'; +import { renderHook, waitFor } from 'soapbox/jest/test-helpers.tsx'; +import { GroupRoles } from 'soapbox/schemas/group-member.ts'; -import { useGroupMembers } from './useGroupMembers'; +import { useGroupMembers } from './useGroupMembers.ts'; const groupMember = buildGroupMember(); const groupId = '1'; diff --git a/src/api/hooks/groups/useGroupMembers.ts b/src/api/hooks/groups/useGroupMembers.ts index a9b03e7f2..74a7d5f9b 100644 --- a/src/api/hooks/groups/useGroupMembers.ts +++ b/src/api/hooks/groups/useGroupMembers.ts @@ -1,9 +1,9 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { GroupMember, groupMemberSchema } from 'soapbox/schemas'; -import { GroupRoles } from 'soapbox/schemas/group-member'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { GroupRoles } from 'soapbox/schemas/group-member.ts'; +import { GroupMember, groupMemberSchema } from 'soapbox/schemas/index.ts'; -import { useApi } from '../../../hooks/useApi'; +import { useApi } from '../../../hooks/useApi.ts'; function useGroupMembers(groupId: string, role: GroupRoles) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupMembershipRequests.ts b/src/api/hooks/groups/useGroupMembershipRequests.ts index f175b21da..6d0771c12 100644 --- a/src/api/hooks/groups/useGroupMembershipRequests.ts +++ b/src/api/hooks/groups/useGroupMembershipRequests.ts @@ -1,12 +1,12 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useDismissEntity, useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { accountSchema } from 'soapbox/schemas'; -import { GroupRoles } from 'soapbox/schemas/group-member'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useDismissEntity, useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { GroupRoles } from 'soapbox/schemas/group-member.ts'; +import { accountSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationship } from './useGroupRelationship'; +import { useGroupRelationship } from './useGroupRelationship.ts'; -import type { ExpandedEntitiesPath } from 'soapbox/entity-store/hooks/types'; +import type { ExpandedEntitiesPath } from 'soapbox/entity-store/hooks/types.ts'; function useGroupMembershipRequests(groupId: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupMutes.ts b/src/api/hooks/groups/useGroupMutes.ts index 67eca0772..7b1364915 100644 --- a/src/api/hooks/groups/useGroupMutes.ts +++ b/src/api/hooks/groups/useGroupMutes.ts @@ -1,10 +1,10 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useFeatures } from 'soapbox/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useFeatures } from 'soapbox/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useGroupMutes() { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupRelationship.ts b/src/api/hooks/groups/useGroupRelationship.ts index 95193b865..b7846be22 100644 --- a/src/api/hooks/groups/useGroupRelationship.ts +++ b/src/api/hooks/groups/useGroupRelationship.ts @@ -1,9 +1,9 @@ import { z } from 'zod'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { type GroupRelationship, groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { type GroupRelationship, groupRelationshipSchema } from 'soapbox/schemas/index.ts'; function useGroupRelationship(groupId: string | undefined) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupRelationships.ts b/src/api/hooks/groups/useGroupRelationships.ts index 902d0473f..cee6b4f81 100644 --- a/src/api/hooks/groups/useGroupRelationships.ts +++ b/src/api/hooks/groups/useGroupRelationships.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities'; -import { useApi, useLoggedIn } from 'soapbox/hooks'; -import { type GroupRelationship, groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities.ts'; +import { useApi, useLoggedIn } from 'soapbox/hooks/index.ts'; +import { type GroupRelationship, groupRelationshipSchema } from 'soapbox/schemas/index.ts'; function useGroupRelationships(listKey: string[], ids: string[]) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupSearch.ts b/src/api/hooks/groups/useGroupSearch.ts index 946e208bb..c13f27b67 100644 --- a/src/api/hooks/groups/useGroupSearch.ts +++ b/src/api/hooks/groups/useGroupSearch.ts @@ -1,11 +1,11 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures } from 'soapbox/hooks'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures } from 'soapbox/hooks/index.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationships } from './useGroupRelationships'; +import { useGroupRelationships } from './useGroupRelationships.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useGroupSearch(search: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupTag.ts b/src/api/hooks/groups/useGroupTag.ts index d0e63d74d..446b3b492 100644 --- a/src/api/hooks/groups/useGroupTag.ts +++ b/src/api/hooks/groups/useGroupTag.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { type GroupTag, groupTagSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { type GroupTag, groupTagSchema } from 'soapbox/schemas/index.ts'; function useGroupTag(tagId: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupTags.ts b/src/api/hooks/groups/useGroupTags.ts index b2c29aa3c..3b4846f08 100644 --- a/src/api/hooks/groups/useGroupTags.ts +++ b/src/api/hooks/groups/useGroupTags.ts @@ -1,9 +1,9 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { groupTagSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { groupTagSchema } from 'soapbox/schemas/index.ts'; -import type { GroupTag } from 'soapbox/schemas'; +import type { GroupTag } from 'soapbox/schemas/index.ts'; function useGroupTags(groupId: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupValidation.ts b/src/api/hooks/groups/useGroupValidation.ts index 1b008b0b1..40b51c99a 100644 --- a/src/api/hooks/groups/useGroupValidation.ts +++ b/src/api/hooks/groups/useGroupValidation.ts @@ -1,8 +1,8 @@ import { useQuery } from '@tanstack/react-query'; -import { HTTPError } from 'soapbox/api/HTTPError'; -import { useApi } from 'soapbox/hooks/useApi'; -import { useFeatures } from 'soapbox/hooks/useFeatures'; +import { HTTPError } from 'soapbox/api/HTTPError.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; type Validation = { error: string; diff --git a/src/api/hooks/groups/useGroups.test.ts b/src/api/hooks/groups/useGroups.test.ts index 3cbddf98a..8a91db69c 100644 --- a/src/api/hooks/groups/useGroups.test.ts +++ b/src/api/hooks/groups/useGroups.test.ts @@ -1,11 +1,11 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { buildGroup } from 'soapbox/jest/factory'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; -import { instanceV1Schema } from 'soapbox/schemas/instance'; +import { __stub } from 'soapbox/api/index.ts'; +import { buildGroup } from 'soapbox/jest/factory.ts'; +import { renderHook, waitFor } from 'soapbox/jest/test-helpers.tsx'; +import { instanceV1Schema } from 'soapbox/schemas/instance.ts'; -import { useGroups } from './useGroups'; +import { useGroups } from './useGroups.ts'; const group = buildGroup({ id: '1', display_name: 'soapbox' }); const store = { diff --git a/src/api/hooks/groups/useGroups.ts b/src/api/hooks/groups/useGroups.ts index eb5b4161f..2f2c9de2f 100644 --- a/src/api/hooks/groups/useGroups.ts +++ b/src/api/hooks/groups/useGroups.ts @@ -1,10 +1,10 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { useFeatures } from 'soapbox/hooks/useFeatures'; -import { groupSchema, type Group } from 'soapbox/schemas/group'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; +import { groupSchema, type Group } from 'soapbox/schemas/group.ts'; -import { useGroupRelationships } from './useGroupRelationships'; +import { useGroupRelationships } from './useGroupRelationships.ts'; function useGroups(q: string = '') { const api = useApi(); diff --git a/src/api/hooks/groups/useGroupsFromTag.ts b/src/api/hooks/groups/useGroupsFromTag.ts index 6c2b88bb1..c1b0bfa92 100644 --- a/src/api/hooks/groups/useGroupsFromTag.ts +++ b/src/api/hooks/groups/useGroupsFromTag.ts @@ -1,11 +1,11 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures } from 'soapbox/hooks'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures } from 'soapbox/hooks/index.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationships } from './useGroupRelationships'; +import { useGroupRelationships } from './useGroupRelationships.ts'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; function useGroupsFromTag(tagId: string) { const api = useApi(); diff --git a/src/api/hooks/groups/useJoinGroup.ts b/src/api/hooks/groups/useJoinGroup.ts index 0ea9293d9..4d1cf23ed 100644 --- a/src/api/hooks/groups/useJoinGroup.ts +++ b/src/api/hooks/groups/useJoinGroup.ts @@ -1,10 +1,10 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { groupRelationshipSchema } from 'soapbox/schemas/index.ts'; -import { useGroups } from './useGroups'; +import { useGroups } from './useGroups.ts'; -import type { Group, GroupRelationship } from 'soapbox/schemas'; +import type { Group, GroupRelationship } from 'soapbox/schemas/index.ts'; function useJoinGroup(group: Group) { const { invalidate } = useGroups(); diff --git a/src/api/hooks/groups/useLeaveGroup.ts b/src/api/hooks/groups/useLeaveGroup.ts index e1b11e737..5ff009547 100644 --- a/src/api/hooks/groups/useLeaveGroup.ts +++ b/src/api/hooks/groups/useLeaveGroup.ts @@ -1,10 +1,10 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { groupRelationshipSchema } from 'soapbox/schemas/index.ts'; -import { useGroups } from './useGroups'; +import { useGroups } from './useGroups.ts'; -import type { Group, GroupRelationship } from 'soapbox/schemas'; +import type { Group, GroupRelationship } from 'soapbox/schemas/index.ts'; function useLeaveGroup(group: Group) { const { invalidate } = useGroups(); diff --git a/src/api/hooks/groups/useMuteGroup.ts b/src/api/hooks/groups/useMuteGroup.ts index e31c7f4d1..1bef33e83 100644 --- a/src/api/hooks/groups/useMuteGroup.ts +++ b/src/api/hooks/groups/useMuteGroup.ts @@ -1,6 +1,6 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { type Group, groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { type Group, groupRelationshipSchema } from 'soapbox/schemas/index.ts'; function useMuteGroup(group?: Group) { const { createEntity, isSubmitting } = useEntityActions( diff --git a/src/api/hooks/groups/usePendingGroups.test.ts b/src/api/hooks/groups/usePendingGroups.test.ts index 5c39902e9..1a380f459 100644 --- a/src/api/hooks/groups/usePendingGroups.test.ts +++ b/src/api/hooks/groups/usePendingGroups.test.ts @@ -1,12 +1,12 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { Entities } from 'soapbox/entity-store/entities'; -import { buildAccount, buildGroup } from 'soapbox/jest/factory'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; -import { instanceV1Schema } from 'soapbox/schemas/instance'; +import { __stub } from 'soapbox/api/index.ts'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { buildAccount, buildGroup } from 'soapbox/jest/factory.ts'; +import { renderHook, waitFor } from 'soapbox/jest/test-helpers.tsx'; +import { instanceV1Schema } from 'soapbox/schemas/instance.ts'; -import { usePendingGroups } from './usePendingGroups'; +import { usePendingGroups } from './usePendingGroups.ts'; const id = '1'; const group = buildGroup({ id, display_name: 'soapbox' }); diff --git a/src/api/hooks/groups/usePendingGroups.ts b/src/api/hooks/groups/usePendingGroups.ts index be5d8c400..06c805362 100644 --- a/src/api/hooks/groups/usePendingGroups.ts +++ b/src/api/hooks/groups/usePendingGroups.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures, useOwnAccount } from 'soapbox/hooks'; -import { Group, groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures, useOwnAccount } from 'soapbox/hooks/index.ts'; +import { Group, groupSchema } from 'soapbox/schemas/index.ts'; function usePendingGroups() { const api = useApi(); diff --git a/src/api/hooks/groups/usePopularGroups.ts b/src/api/hooks/groups/usePopularGroups.ts index 69b04e32f..57dde7cfa 100644 --- a/src/api/hooks/groups/usePopularGroups.ts +++ b/src/api/hooks/groups/usePopularGroups.ts @@ -1,11 +1,11 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { Group, groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { Group, groupSchema } from 'soapbox/schemas/index.ts'; -import { useApi } from '../../../hooks/useApi'; -import { useFeatures } from '../../../hooks/useFeatures'; +import { useApi } from '../../../hooks/useApi.ts'; +import { useFeatures } from '../../../hooks/useFeatures.ts'; -import { useGroupRelationships } from './useGroupRelationships'; +import { useGroupRelationships } from './useGroupRelationships.ts'; function usePopularGroups() { const api = useApi(); diff --git a/src/api/hooks/groups/usePopularTags.ts b/src/api/hooks/groups/usePopularTags.ts index e0ec2c550..2126a57d2 100644 --- a/src/api/hooks/groups/usePopularTags.ts +++ b/src/api/hooks/groups/usePopularTags.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures } from 'soapbox/hooks'; -import { type GroupTag, groupTagSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures } from 'soapbox/hooks/index.ts'; +import { type GroupTag, groupTagSchema } from 'soapbox/schemas/index.ts'; function usePopularTags() { const api = useApi(); diff --git a/src/api/hooks/groups/usePromoteGroupMember.ts b/src/api/hooks/groups/usePromoteGroupMember.ts index 3d23dda62..36b09a6f9 100644 --- a/src/api/hooks/groups/usePromoteGroupMember.ts +++ b/src/api/hooks/groups/usePromoteGroupMember.ts @@ -1,10 +1,10 @@ import { z } from 'zod'; -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { groupMemberSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { groupMemberSchema } from 'soapbox/schemas/index.ts'; -import type { Group, GroupMember } from 'soapbox/schemas'; +import type { Group, GroupMember } from 'soapbox/schemas/index.ts'; function usePromoteGroupMember(group: Group, groupMember: GroupMember) { const { createEntity } = useEntityActions( diff --git a/src/api/hooks/groups/useSuggestedGroups.ts b/src/api/hooks/groups/useSuggestedGroups.ts index 69fb71065..a54fbffd2 100644 --- a/src/api/hooks/groups/useSuggestedGroups.ts +++ b/src/api/hooks/groups/useSuggestedGroups.ts @@ -1,9 +1,9 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi, useFeatures } from 'soapbox/hooks'; -import { type Group, groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi, useFeatures } from 'soapbox/hooks/index.ts'; +import { type Group, groupSchema } from 'soapbox/schemas/index.ts'; -import { useGroupRelationships } from './useGroupRelationships'; +import { useGroupRelationships } from './useGroupRelationships.ts'; function useSuggestedGroups() { const api = useApi(); diff --git a/src/api/hooks/groups/useUnmuteGroup.ts b/src/api/hooks/groups/useUnmuteGroup.ts index 6c8768d25..9402b4a65 100644 --- a/src/api/hooks/groups/useUnmuteGroup.ts +++ b/src/api/hooks/groups/useUnmuteGroup.ts @@ -1,6 +1,6 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; -import { type Group, groupRelationshipSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; +import { type Group, groupRelationshipSchema } from 'soapbox/schemas/index.ts'; function useUnmuteGroup(group?: Group) { const { createEntity, isSubmitting } = useEntityActions( diff --git a/src/api/hooks/groups/useUpdateGroup.ts b/src/api/hooks/groups/useUpdateGroup.ts index 129849514..da660e735 100644 --- a/src/api/hooks/groups/useUpdateGroup.ts +++ b/src/api/hooks/groups/useUpdateGroup.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks/useApi'; -import { groupSchema } from 'soapbox/schemas'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/useApi.ts'; +import { groupSchema } from 'soapbox/schemas/index.ts'; interface UpdateGroupParams { display_name?: string; diff --git a/src/api/hooks/groups/useUpdateGroupTag.ts b/src/api/hooks/groups/useUpdateGroupTag.ts index 1c68c714d..203b4f4ca 100644 --- a/src/api/hooks/groups/useUpdateGroupTag.ts +++ b/src/api/hooks/groups/useUpdateGroupTag.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; -import type { GroupTag } from 'soapbox/schemas'; +import type { GroupTag } from 'soapbox/schemas/index.ts'; function useUpdateGroupTag(groupId: string, tagId: string) { const { updateEntity, ...rest } = useEntityActions( diff --git a/src/api/hooks/index.ts b/src/api/hooks/index.ts index a3afe87a4..e5044ab74 100644 --- a/src/api/hooks/index.ts +++ b/src/api/hooks/index.ts @@ -1,61 +1,61 @@ // Accounts -export { useAccount } from './accounts/useAccount'; -export { useAccountLookup } from './accounts/useAccountLookup'; +export { useAccount } from './accounts/useAccount.ts'; +export { useAccountLookup } from './accounts/useAccountLookup.ts'; export { useBlocks, useMutes, useFollowers, useFollowing, -} from './accounts/useAccountList'; -export { useFollow } from './accounts/useFollow'; -export { useRelationships } from './accounts/useRelationships'; -export { usePatronUser } from './accounts/usePatronUser'; +} from './accounts/useAccountList.ts'; +export { useFollow } from './accounts/useFollow.ts'; +export { useRelationships } from './accounts/useRelationships.ts'; +export { usePatronUser } from './accounts/usePatronUser.ts'; // Groups -export { useBlockGroupMember } from './groups/useBlockGroupMember'; -export { useCancelMembershipRequest } from './groups/useCancelMembershipRequest'; -export { useCreateGroup, type CreateGroupParams } from './groups/useCreateGroup'; -export { useDeleteGroup } from './groups/useDeleteGroup'; -export { useDemoteGroupMember } from './groups/useDemoteGroupMember'; -export { useGroup } from './groups/useGroup'; -export { useGroupLookup } from './groups/useGroupLookup'; -export { useGroupMedia } from './groups/useGroupMedia'; -export { useGroupMembers } from './groups/useGroupMembers'; -export { useGroupMembershipRequests } from './groups/useGroupMembershipRequests'; -export { useGroupMutes } from './groups/useGroupMutes'; -export { useGroupRelationship } from './groups/useGroupRelationship'; -export { useGroupRelationships } from './groups/useGroupRelationships'; -export { useGroupSearch } from './groups/useGroupSearch'; -export { useGroupTag } from './groups/useGroupTag'; -export { useGroupTags } from './groups/useGroupTags'; -export { useGroupValidation } from './groups/useGroupValidation'; -export { useGroups } from './groups/useGroups'; -export { useGroupsFromTag } from './groups/useGroupsFromTag'; -export { useJoinGroup } from './groups/useJoinGroup'; -export { useMuteGroup } from './groups/useMuteGroup'; -export { useLeaveGroup } from './groups/useLeaveGroup'; -export { usePendingGroups } from './groups/usePendingGroups'; -export { usePopularGroups } from './groups/usePopularGroups'; -export { usePopularTags } from './groups/usePopularTags'; -export { usePromoteGroupMember } from './groups/usePromoteGroupMember'; -export { useSuggestedGroups } from './groups/useSuggestedGroups'; -export { useUnmuteGroup } from './groups/useUnmuteGroup'; -export { useUpdateGroup } from './groups/useUpdateGroup'; -export { useUpdateGroupTag } from './groups/useUpdateGroupTag'; +export { useBlockGroupMember } from './groups/useBlockGroupMember.ts'; +export { useCancelMembershipRequest } from './groups/useCancelMembershipRequest.ts'; +export { useCreateGroup, type CreateGroupParams } from './groups/useCreateGroup.ts'; +export { useDeleteGroup } from './groups/useDeleteGroup.ts'; +export { useDemoteGroupMember } from './groups/useDemoteGroupMember.ts'; +export { useGroup } from './groups/useGroup.ts'; +export { useGroupLookup } from './groups/useGroupLookup.ts'; +export { useGroupMedia } from './groups/useGroupMedia.ts'; +export { useGroupMembers } from './groups/useGroupMembers.ts'; +export { useGroupMembershipRequests } from './groups/useGroupMembershipRequests.ts'; +export { useGroupMutes } from './groups/useGroupMutes.ts'; +export { useGroupRelationship } from './groups/useGroupRelationship.ts'; +export { useGroupRelationships } from './groups/useGroupRelationships.ts'; +export { useGroupSearch } from './groups/useGroupSearch.ts'; +export { useGroupTag } from './groups/useGroupTag.ts'; +export { useGroupTags } from './groups/useGroupTags.ts'; +export { useGroupValidation } from './groups/useGroupValidation.ts'; +export { useGroups } from './groups/useGroups.ts'; +export { useGroupsFromTag } from './groups/useGroupsFromTag.ts'; +export { useJoinGroup } from './groups/useJoinGroup.ts'; +export { useMuteGroup } from './groups/useMuteGroup.ts'; +export { useLeaveGroup } from './groups/useLeaveGroup.ts'; +export { usePendingGroups } from './groups/usePendingGroups.ts'; +export { usePopularGroups } from './groups/usePopularGroups.ts'; +export { usePopularTags } from './groups/usePopularTags.ts'; +export { usePromoteGroupMember } from './groups/usePromoteGroupMember.ts'; +export { useSuggestedGroups } from './groups/useSuggestedGroups.ts'; +export { useUnmuteGroup } from './groups/useUnmuteGroup.ts'; +export { useUpdateGroup } from './groups/useUpdateGroup.ts'; +export { useUpdateGroupTag } from './groups/useUpdateGroupTag.ts'; // Statuses -export { useBookmarkFolders } from './statuses/useBookmarkFolders'; -export { useBookmarkFolder } from './statuses/useBookmarkFolder'; -export { useCreateBookmarkFolder } from './statuses/useCreateBookmarkFolder'; -export { useDeleteBookmarkFolder } from './statuses/useDeleteBookmarkFolder'; -export { useUpdateBookmarkFolder } from './statuses/useUpdateBookmarkFolder'; +export { useBookmarkFolders } from './statuses/useBookmarkFolders.ts'; +export { useBookmarkFolder } from './statuses/useBookmarkFolder.ts'; +export { useCreateBookmarkFolder } from './statuses/useCreateBookmarkFolder.ts'; +export { useDeleteBookmarkFolder } from './statuses/useDeleteBookmarkFolder.ts'; +export { useUpdateBookmarkFolder } from './statuses/useUpdateBookmarkFolder.ts'; // Streaming -export { useUserStream } from './streaming/useUserStream'; -export { useCommunityStream } from './streaming/useCommunityStream'; -export { usePublicStream } from './streaming/usePublicStream'; -export { useDirectStream } from './streaming/useDirectStream'; -export { useHashtagStream } from './streaming/useHashtagStream'; -export { useListStream } from './streaming/useListStream'; -export { useGroupStream } from './streaming/useGroupStream'; -export { useRemoteStream } from './streaming/useRemoteStream'; +export { useUserStream } from './streaming/useUserStream.ts'; +export { useCommunityStream } from './streaming/useCommunityStream.ts'; +export { usePublicStream } from './streaming/usePublicStream.ts'; +export { useDirectStream } from './streaming/useDirectStream.ts'; +export { useHashtagStream } from './streaming/useHashtagStream.ts'; +export { useListStream } from './streaming/useListStream.ts'; +export { useGroupStream } from './streaming/useGroupStream.ts'; +export { useRemoteStream } from './streaming/useRemoteStream.ts'; diff --git a/src/api/hooks/instance/useInstanceV1.ts b/src/api/hooks/instance/useInstanceV1.ts index c1e802156..45b014fe9 100644 --- a/src/api/hooks/instance/useInstanceV1.ts +++ b/src/api/hooks/instance/useInstanceV1.ts @@ -1,7 +1,7 @@ import { useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance.ts'; interface Opts { /** The base URL of the instance. */ diff --git a/src/api/hooks/instance/useInstanceV2.ts b/src/api/hooks/instance/useInstanceV2.ts index 25b1de014..5667bf022 100644 --- a/src/api/hooks/instance/useInstanceV2.ts +++ b/src/api/hooks/instance/useInstanceV2.ts @@ -1,7 +1,7 @@ import { useQuery } from '@tanstack/react-query'; -import { useApi } from 'soapbox/hooks'; -import { InstanceV2, instanceV2Schema } from 'soapbox/schemas/instance'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { InstanceV2, instanceV2Schema } from 'soapbox/schemas/instance.ts'; interface Opts { /** The base URL of the instance. */ diff --git a/src/api/hooks/statuses/useBookmarkFolder.ts b/src/api/hooks/statuses/useBookmarkFolder.ts index f81d9e7d1..dd5e5fc56 100644 --- a/src/api/hooks/statuses/useBookmarkFolder.ts +++ b/src/api/hooks/statuses/useBookmarkFolder.ts @@ -1,9 +1,9 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { selectEntity } from 'soapbox/entity-store/selectors'; -import { useAppSelector } from 'soapbox/hooks'; -import { type BookmarkFolder } from 'soapbox/schemas/bookmark-folder'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { selectEntity } from 'soapbox/entity-store/selectors.ts'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; +import { type BookmarkFolder } from 'soapbox/schemas/bookmark-folder.ts'; -import { useBookmarkFolders } from './useBookmarkFolders'; +import { useBookmarkFolders } from './useBookmarkFolders.ts'; function useBookmarkFolder(folderId?: string) { const { diff --git a/src/api/hooks/statuses/useBookmarkFolders.ts b/src/api/hooks/statuses/useBookmarkFolders.ts index 77538a97a..c48ac9e15 100644 --- a/src/api/hooks/statuses/useBookmarkFolders.ts +++ b/src/api/hooks/statuses/useBookmarkFolders.ts @@ -1,8 +1,8 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntities } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { useFeatures } from 'soapbox/hooks/useFeatures'; -import { bookmarkFolderSchema, type BookmarkFolder } from 'soapbox/schemas/bookmark-folder'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntities } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; +import { bookmarkFolderSchema, type BookmarkFolder } from 'soapbox/schemas/bookmark-folder.ts'; function useBookmarkFolders() { const api = useApi(); diff --git a/src/api/hooks/statuses/useCreateBookmarkFolder.ts b/src/api/hooks/statuses/useCreateBookmarkFolder.ts index ded24ff97..477c1fe45 100644 --- a/src/api/hooks/statuses/useCreateBookmarkFolder.ts +++ b/src/api/hooks/statuses/useCreateBookmarkFolder.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { bookmarkFolderSchema } from 'soapbox/schemas/bookmark-folder'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { bookmarkFolderSchema } from 'soapbox/schemas/bookmark-folder.ts'; interface CreateBookmarkFolderParams { name: string; diff --git a/src/api/hooks/statuses/useDeleteBookmarkFolder.ts b/src/api/hooks/statuses/useDeleteBookmarkFolder.ts index cd8018c2d..cbfacd830 100644 --- a/src/api/hooks/statuses/useDeleteBookmarkFolder.ts +++ b/src/api/hooks/statuses/useDeleteBookmarkFolder.ts @@ -1,5 +1,5 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useEntityActions } from 'soapbox/entity-store/hooks'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useEntityActions } from 'soapbox/entity-store/hooks/index.ts'; function useDeleteBookmarkFolder() { const { deleteEntity, isSubmitting } = useEntityActions( diff --git a/src/api/hooks/statuses/useUpdateBookmarkFolder.ts b/src/api/hooks/statuses/useUpdateBookmarkFolder.ts index 2e023b04b..d21aac1f9 100644 --- a/src/api/hooks/statuses/useUpdateBookmarkFolder.ts +++ b/src/api/hooks/statuses/useUpdateBookmarkFolder.ts @@ -1,7 +1,7 @@ -import { Entities } from 'soapbox/entity-store/entities'; -import { useCreateEntity } from 'soapbox/entity-store/hooks'; -import { useApi } from 'soapbox/hooks'; -import { bookmarkFolderSchema } from 'soapbox/schemas/bookmark-folder'; +import { Entities } from 'soapbox/entity-store/entities.ts'; +import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { bookmarkFolderSchema } from 'soapbox/schemas/bookmark-folder.ts'; interface UpdateBookmarkFolderParams { name: string; diff --git a/src/api/hooks/streaming/useCommunityStream.ts b/src/api/hooks/streaming/useCommunityStream.ts index ce00d4674..0ee8b3335 100644 --- a/src/api/hooks/streaming/useCommunityStream.ts +++ b/src/api/hooks/streaming/useCommunityStream.ts @@ -1,4 +1,4 @@ -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; interface UseCommunityStreamOpts { onlyMedia?: boolean; diff --git a/src/api/hooks/streaming/useDirectStream.ts b/src/api/hooks/streaming/useDirectStream.ts index 972a5f769..cf343a09b 100644 --- a/src/api/hooks/streaming/useDirectStream.ts +++ b/src/api/hooks/streaming/useDirectStream.ts @@ -1,6 +1,6 @@ -import { useLoggedIn } from 'soapbox/hooks/useLoggedIn'; +import { useLoggedIn } from 'soapbox/hooks/useLoggedIn.ts'; -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; function useDirectStream() { const { isLoggedIn } = useLoggedIn(); diff --git a/src/api/hooks/streaming/useGroupStream.ts b/src/api/hooks/streaming/useGroupStream.ts index f9db3f69e..796953748 100644 --- a/src/api/hooks/streaming/useGroupStream.ts +++ b/src/api/hooks/streaming/useGroupStream.ts @@ -1,4 +1,4 @@ -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; function useGroupStream(groupId: string) { return useTimelineStream( diff --git a/src/api/hooks/streaming/useHashtagStream.ts b/src/api/hooks/streaming/useHashtagStream.ts index 4f9483bad..788b3f3fd 100644 --- a/src/api/hooks/streaming/useHashtagStream.ts +++ b/src/api/hooks/streaming/useHashtagStream.ts @@ -1,4 +1,4 @@ -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; function useHashtagStream(tag: string) { return useTimelineStream( diff --git a/src/api/hooks/streaming/useListStream.ts b/src/api/hooks/streaming/useListStream.ts index 661bdce4f..4b859b8d6 100644 --- a/src/api/hooks/streaming/useListStream.ts +++ b/src/api/hooks/streaming/useListStream.ts @@ -1,6 +1,6 @@ -import { useLoggedIn } from 'soapbox/hooks'; +import { useLoggedIn } from 'soapbox/hooks/index.ts'; -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; function useListStream(listId: string) { const { isLoggedIn } = useLoggedIn(); diff --git a/src/api/hooks/streaming/usePublicStream.ts b/src/api/hooks/streaming/usePublicStream.ts index 81c25bde4..cfc9e63af 100644 --- a/src/api/hooks/streaming/usePublicStream.ts +++ b/src/api/hooks/streaming/usePublicStream.ts @@ -1,4 +1,4 @@ -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; interface UsePublicStreamOpts { onlyMedia?: boolean; diff --git a/src/api/hooks/streaming/useRemoteStream.ts b/src/api/hooks/streaming/useRemoteStream.ts index 6de560163..53fa36358 100644 --- a/src/api/hooks/streaming/useRemoteStream.ts +++ b/src/api/hooks/streaming/useRemoteStream.ts @@ -1,4 +1,4 @@ -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; interface UseRemoteStreamOpts { instance: string; diff --git a/src/api/hooks/streaming/useTimelineStream.ts b/src/api/hooks/streaming/useTimelineStream.ts index 97328f7ae..8225e1da3 100644 --- a/src/api/hooks/streaming/useTimelineStream.ts +++ b/src/api/hooks/streaming/useTimelineStream.ts @@ -1,8 +1,8 @@ import { useEffect, useRef } from 'react'; -import { connectTimelineStream } from 'soapbox/actions/streaming'; -import { useAppDispatch, useAppSelector, useInstance } from 'soapbox/hooks'; -import { getAccessToken } from 'soapbox/utils/auth'; +import { connectTimelineStream } from 'soapbox/actions/streaming.ts'; +import { useAppDispatch, useAppSelector, useInstance } from 'soapbox/hooks/index.ts'; +import { getAccessToken } from 'soapbox/utils/auth.ts'; function useTimelineStream(...args: Parameters) { // TODO: get rid of streaming.ts and move the actual opts here. diff --git a/src/api/hooks/streaming/useUserStream.ts b/src/api/hooks/streaming/useUserStream.ts index f068b3c1c..9554917bc 100644 --- a/src/api/hooks/streaming/useUserStream.ts +++ b/src/api/hooks/streaming/useUserStream.ts @@ -1,11 +1,11 @@ -import { expandNotifications } from 'soapbox/actions/notifications'; -import { expandHomeTimeline } from 'soapbox/actions/timelines'; -import { useStatContext } from 'soapbox/contexts/stat-context'; -import { useLoggedIn } from 'soapbox/hooks'; +import { expandNotifications } from 'soapbox/actions/notifications.ts'; +import { expandHomeTimeline } from 'soapbox/actions/timelines.ts'; +import { useStatContext } from 'soapbox/contexts/stat-context.tsx'; +import { useLoggedIn } from 'soapbox/hooks/index.ts'; -import { useTimelineStream } from './useTimelineStream'; +import { useTimelineStream } from './useTimelineStream.ts'; -import type { AppDispatch } from 'soapbox/store'; +import type { AppDispatch } from 'soapbox/store.ts'; function useUserStream() { const { isLoggedIn } = useLoggedIn(); diff --git a/src/api/hooks/zap-split/useZapSplit.ts b/src/api/hooks/zap-split/useZapSplit.ts index 94451e946..3261907fe 100644 --- a/src/api/hooks/zap-split/useZapSplit.ts +++ b/src/api/hooks/zap-split/useZapSplit.ts @@ -1,9 +1,9 @@ import { useState, useEffect } from 'react'; -import { useApi } from 'soapbox/hooks'; -import { baseZapAccountSchema, type ZapSplitData } from 'soapbox/schemas/zap-split'; +import { useApi } from 'soapbox/hooks/index.ts'; +import { baseZapAccountSchema, type ZapSplitData } from 'soapbox/schemas/zap-split.ts'; -import type { Account as AccountEntity, Status as StatusEntity } from 'soapbox/types/entities'; +import type { Account as AccountEntity, Status as StatusEntity } from 'soapbox/types/entities.ts'; interface SplitValue { id: string; diff --git a/src/api/index.ts b/src/api/index.ts index 3e5f637a7..7a7e9aeaf 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -8,10 +8,10 @@ import axios, { type AxiosInstance, type AxiosResponse } from 'axios'; import LinkHeader from 'http-link-header'; import { createSelector } from 'reselect'; -import * as BuildConfig from 'soapbox/build-config'; -import { selectAccount } from 'soapbox/selectors'; -import { RootState } from 'soapbox/store'; -import { getAccessToken, getAppToken, isURL, parseBaseURL } from 'soapbox/utils/auth'; +import * as BuildConfig from 'soapbox/build-config.ts'; +import { selectAccount } from 'soapbox/selectors/index.ts'; +import { RootState } from 'soapbox/store.ts'; +import { getAccessToken, getAppToken, isURL, parseBaseURL } from 'soapbox/utils/auth.ts'; import type MockAdapter from 'axios-mock-adapter'; diff --git a/src/build-config.ts b/src/build-config.ts index c742a1212..d8799de7e 100644 --- a/src/build-config.ts +++ b/src/build-config.ts @@ -1,4 +1,4 @@ -import type { SoapboxEnv } from './build-config-compiletime'; +import type { SoapboxEnv } from './build-config-compiletime.ts'; export const { NODE_ENV, diff --git a/src/components/account-search.tsx b/src/components/account-search.tsx index 673cd5d66..5b78a12b1 100644 --- a/src/components/account-search.tsx +++ b/src/components/account-search.tsx @@ -4,9 +4,9 @@ import clsx from 'clsx'; import { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import AutosuggestAccountInput from 'soapbox/components/autosuggest-account-input'; +import AutosuggestAccountInput from 'soapbox/components/autosuggest-account-input.tsx'; -import SvgIcon from './ui/icon/svg-icon'; +import SvgIcon from './ui/icon/svg-icon.tsx'; const messages = defineMessages({ placeholder: { id: 'account_search.placeholder', defaultMessage: 'Search for an account' }, diff --git a/src/components/account.test.tsx b/src/components/account.test.tsx index ef1c4cf74..69f984831 100644 --- a/src/components/account.test.tsx +++ b/src/components/account.test.tsx @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; -import { buildAccount } from 'soapbox/jest/factory'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { buildAccount } from 'soapbox/jest/factory.ts'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import Account from './account'; +import Account from './account.tsx'; describe('', () => { it('renders account name and username', () => { diff --git a/src/components/account.tsx b/src/components/account.tsx index e19936af1..11e35dc78 100644 --- a/src/components/account.tsx +++ b/src/components/account.tsx @@ -3,19 +3,19 @@ import { useRef, useState } from 'react'; import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { Link, useHistory } from 'react-router-dom'; -import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; -import VerificationBadge from 'soapbox/components/verification-badge'; -import ActionButton from 'soapbox/features/ui/components/action-button'; -import { useAppSelector } from 'soapbox/hooks'; -import { getAcct } from 'soapbox/utils/accounts'; -import { displayFqn } from 'soapbox/utils/state'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper.tsx'; +import VerificationBadge from 'soapbox/components/verification-badge.tsx'; +import ActionButton from 'soapbox/features/ui/components/action-button.tsx'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; +import { getAcct } from 'soapbox/utils/accounts.ts'; +import { displayFqn } from 'soapbox/utils/state.ts'; -import Badge from './badge'; -import RelativeTimestamp from './relative-timestamp'; -import { Avatar, Emoji, HStack, Icon, IconButton, Stack, Text } from './ui'; +import Badge from './badge.tsx'; +import RelativeTimestamp from './relative-timestamp.tsx'; +import { Avatar, Emoji, HStack, Icon, IconButton, Stack, Text } from './ui/index.ts'; -import type { StatusApprovalStatus } from 'soapbox/normalizers/status'; -import type { Account as AccountSchema } from 'soapbox/schemas'; +import type { StatusApprovalStatus } from 'soapbox/normalizers/status.ts'; +import type { Account as AccountSchema } from 'soapbox/schemas/index.ts'; interface IInstanceFavicon { account: AccountSchema; diff --git a/src/components/animated-number.tsx b/src/components/animated-number.tsx index 4fbe7eff2..123599246 100644 --- a/src/components/animated-number.tsx +++ b/src/components/animated-number.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import { FormattedNumber } from 'react-intl'; import { TransitionMotion, spring } from 'react-motion'; -import { useSettings } from 'soapbox/hooks'; +import { useSettings } from 'soapbox/hooks/index.ts'; const obfuscatedCount = (count: number) => { if (count < 0) { diff --git a/src/components/announcements/announcement-content.tsx b/src/components/announcements/announcement-content.tsx index c1f8fb5d9..92dfb605f 100644 --- a/src/components/announcements/announcement-content.tsx +++ b/src/components/announcements/announcement-content.tsx @@ -1,9 +1,9 @@ import { useEffect, useRef } from 'react'; import { useHistory } from 'react-router-dom'; -import { getTextDirection } from 'soapbox/utils/rtl'; +import { getTextDirection } from 'soapbox/utils/rtl.ts'; -import type { Announcement as AnnouncementEntity, Mention as MentionEntity } from 'soapbox/schemas'; +import type { Announcement as AnnouncementEntity, Mention as MentionEntity } from 'soapbox/schemas/index.ts'; interface IAnnouncementContent { announcement: AnnouncementEntity; diff --git a/src/components/announcements/announcement.tsx b/src/components/announcements/announcement.tsx index 47a4d420e..add848c7e 100644 --- a/src/components/announcements/announcement.tsx +++ b/src/components/announcements/announcement.tsx @@ -1,14 +1,14 @@ import { FormattedDate } from 'react-intl'; -import { Stack, Text } from 'soapbox/components/ui'; -import { useFeatures } from 'soapbox/hooks'; -import { getTextDirection } from 'soapbox/utils/rtl'; +import { Stack, Text } from 'soapbox/components/ui/index.ts'; +import { useFeatures } from 'soapbox/hooks/index.ts'; +import { getTextDirection } from 'soapbox/utils/rtl.ts'; -import AnnouncementContent from './announcement-content'; -import ReactionsBar from './reactions-bar'; +import AnnouncementContent from './announcement-content.tsx'; +import ReactionsBar from './reactions-bar.tsx'; import type { Map as ImmutableMap } from 'immutable'; -import type { Announcement as AnnouncementEntity } from 'soapbox/schemas'; +import type { Announcement as AnnouncementEntity } from 'soapbox/schemas/index.ts'; interface IAnnouncement { announcement: AnnouncementEntity; diff --git a/src/components/announcements/announcements-panel.tsx b/src/components/announcements/announcements-panel.tsx index 5ef896b70..c72ece84c 100644 --- a/src/components/announcements/announcements-panel.tsx +++ b/src/components/announcements/announcements-panel.tsx @@ -5,13 +5,13 @@ import { FormattedMessage } from 'react-intl'; import ReactSwipeableViews from 'react-swipeable-views'; import { createSelector } from 'reselect'; -import { useAnnouncements } from 'soapbox/api/hooks/announcements'; -import { Card, HStack, Widget } from 'soapbox/components/ui'; -import { useAppSelector } from 'soapbox/hooks'; +import { useAnnouncements } from 'soapbox/api/hooks/announcements/index.ts'; +import { Card, HStack, Widget } from 'soapbox/components/ui/index.ts'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; -import Announcement from './announcement'; +import Announcement from './announcement.tsx'; -import type { RootState } from 'soapbox/store'; +import type { RootState } from 'soapbox/store.ts'; const customEmojiMap = createSelector([(state: RootState) => state.custom_emojis], items => (items as ImmutableList>).reduce((map, emoji) => map.set(emoji.get('shortcode')!, emoji), ImmutableMap>())); diff --git a/src/components/announcements/emoji.tsx b/src/components/announcements/emoji.tsx index 1deddf26a..eb267038c 100644 --- a/src/components/announcements/emoji.tsx +++ b/src/components/announcements/emoji.tsx @@ -1,6 +1,6 @@ -import unicodeMapping from 'soapbox/features/emoji/mapping'; -import { useSettings } from 'soapbox/hooks'; -import { joinPublicPath } from 'soapbox/utils/static'; +import unicodeMapping from 'soapbox/features/emoji/mapping.ts'; +import { useSettings } from 'soapbox/hooks/index.ts'; +import { joinPublicPath } from 'soapbox/utils/static.ts'; import type { Map as ImmutableMap } from 'immutable'; diff --git a/src/components/announcements/reaction.tsx b/src/components/announcements/reaction.tsx index 23a6d1ef6..ad9c0704e 100644 --- a/src/components/announcements/reaction.tsx +++ b/src/components/announcements/reaction.tsx @@ -1,14 +1,14 @@ import clsx from 'clsx'; import { useState } from 'react'; -import { useAnnouncements } from 'soapbox/api/hooks/announcements'; -import AnimatedNumber from 'soapbox/components/animated-number'; -import unicodeMapping from 'soapbox/features/emoji/mapping'; +import { useAnnouncements } from 'soapbox/api/hooks/announcements/index.ts'; +import AnimatedNumber from 'soapbox/components/animated-number.tsx'; +import unicodeMapping from 'soapbox/features/emoji/mapping.ts'; -import Emoji from './emoji'; +import Emoji from './emoji.tsx'; import type { Map as ImmutableMap } from 'immutable'; -import type { AnnouncementReaction } from 'soapbox/schemas'; +import type { AnnouncementReaction } from 'soapbox/schemas/index.ts'; interface IReaction { announcementId: string; diff --git a/src/components/announcements/reactions-bar.tsx b/src/components/announcements/reactions-bar.tsx index ea778d408..ed4a5756a 100644 --- a/src/components/announcements/reactions-bar.tsx +++ b/src/components/announcements/reactions-bar.tsx @@ -1,15 +1,15 @@ import clsx from 'clsx'; import { TransitionMotion, spring } from 'react-motion'; -import { useAnnouncements } from 'soapbox/api/hooks/announcements'; -import EmojiPickerDropdown from 'soapbox/features/emoji/containers/emoji-picker-dropdown-container'; -import { useSettings } from 'soapbox/hooks'; +import { useAnnouncements } from 'soapbox/api/hooks/announcements/index.ts'; +import EmojiPickerDropdown from 'soapbox/features/emoji/containers/emoji-picker-dropdown-container.tsx'; +import { useSettings } from 'soapbox/hooks/index.ts'; -import Reaction from './reaction'; +import Reaction from './reaction.tsx'; import type { Map as ImmutableMap } from 'immutable'; -import type { Emoji, NativeEmoji } from 'soapbox/features/emoji'; -import type { AnnouncementReaction } from 'soapbox/schemas'; +import type { Emoji, NativeEmoji } from 'soapbox/features/emoji/index.ts'; +import type { AnnouncementReaction } from 'soapbox/schemas/index.ts'; interface IReactionsBar { announcementId: string; diff --git a/src/components/attachment-thumbs.tsx b/src/components/attachment-thumbs.tsx index 17fc301dc..a0a97a5c8 100644 --- a/src/components/attachment-thumbs.tsx +++ b/src/components/attachment-thumbs.tsx @@ -1,11 +1,11 @@ import { Suspense } from 'react'; -import { openModal } from 'soapbox/actions/modals'; -import { MediaGallery } from 'soapbox/features/ui/util/async-components'; -import { useAppDispatch } from 'soapbox/hooks'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { MediaGallery } from 'soapbox/features/ui/util/async-components.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; import type { List as ImmutableList } from 'immutable'; -import type { Attachment } from 'soapbox/types/entities'; +import type { Attachment } from 'soapbox/types/entities.ts'; interface IAttachmentThumbs { media: ImmutableList; diff --git a/src/components/authorize-reject-buttons.tsx b/src/components/authorize-reject-buttons.tsx index c06ddb2be..afdd356c8 100644 --- a/src/components/authorize-reject-buttons.tsx +++ b/src/components/authorize-reject-buttons.tsx @@ -5,7 +5,7 @@ import clsx from 'clsx'; import { useEffect, useRef, useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { HStack, IconButton, Text } from 'soapbox/components/ui'; +import { HStack, IconButton, Text } from 'soapbox/components/ui/index.ts'; interface IAuthorizeRejectButtons { onAuthorize(): Promise | unknown; diff --git a/src/components/autosuggest-account-input.tsx b/src/components/autosuggest-account-input.tsx index 843f419bb..95a0bf9e6 100644 --- a/src/components/autosuggest-account-input.tsx +++ b/src/components/autosuggest-account-input.tsx @@ -2,12 +2,12 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import throttle from 'lodash/throttle'; import { useState, useRef, useCallback, useEffect } from 'react'; -import { accountSearch } from 'soapbox/actions/accounts'; -import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input'; -import { useAppDispatch } from 'soapbox/hooks'; +import { accountSearch } from 'soapbox/actions/accounts.ts'; +import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input.tsx'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; -import type { Menu } from 'soapbox/components/dropdown-menu'; -import type { InputThemes } from 'soapbox/components/ui/input/input'; +import type { Menu } from 'soapbox/components/dropdown-menu/index.ts'; +import type { InputThemes } from 'soapbox/components/ui/input/input.tsx'; const noOp = () => { }; diff --git a/src/components/autosuggest-emoji.test.tsx b/src/components/autosuggest-emoji.test.tsx index 265866c31..289a6ee8e 100644 --- a/src/components/autosuggest-emoji.test.tsx +++ b/src/components/autosuggest-emoji.test.tsx @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import AutosuggestEmoji from './autosuggest-emoji'; +import AutosuggestEmoji from './autosuggest-emoji.tsx'; describe('', () => { it('renders native emoji', () => { diff --git a/src/components/autosuggest-emoji.tsx b/src/components/autosuggest-emoji.tsx index 35cc753f3..218d74012 100644 --- a/src/components/autosuggest-emoji.tsx +++ b/src/components/autosuggest-emoji.tsx @@ -1,8 +1,8 @@ -import { isCustomEmoji } from 'soapbox/features/emoji'; -import unicodeMapping from 'soapbox/features/emoji/mapping'; -import { joinPublicPath } from 'soapbox/utils/static'; +import { isCustomEmoji } from 'soapbox/features/emoji/index.ts'; +import unicodeMapping from 'soapbox/features/emoji/mapping.ts'; +import { joinPublicPath } from 'soapbox/utils/static.ts'; -import type { Emoji } from 'soapbox/features/emoji'; +import type { Emoji } from 'soapbox/features/emoji/index.ts'; interface IAutosuggestEmoji { emoji: Emoji; diff --git a/src/components/autosuggest-input.tsx b/src/components/autosuggest-input.tsx index 5b9bd6373..75fb83c43 100644 --- a/src/components/autosuggest-input.tsx +++ b/src/components/autosuggest-input.tsx @@ -2,15 +2,15 @@ import clsx from 'clsx'; import { List as ImmutableList } from 'immutable'; import { PureComponent } from 'react'; -import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji'; -import Icon from 'soapbox/components/icon'; -import { Input, Portal } from 'soapbox/components/ui'; -import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account'; -import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; +import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji.tsx'; +import Icon from 'soapbox/components/icon.tsx'; +import { Input, Portal } from 'soapbox/components/ui/index.ts'; +import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account.tsx'; +import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions.ts'; -import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu'; -import type { InputThemes } from 'soapbox/components/ui/input/input'; -import type { Emoji } from 'soapbox/features/emoji'; +import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu/index.ts'; +import type { InputThemes } from 'soapbox/components/ui/input/input.tsx'; +import type { Emoji } from 'soapbox/features/emoji/index.ts'; export type AutoSuggestion = string | Emoji; diff --git a/src/components/autosuggest-location.tsx b/src/components/autosuggest-location.tsx index 026af6b47..91315ae85 100644 --- a/src/components/autosuggest-location.tsx +++ b/src/components/autosuggest-location.tsx @@ -3,9 +3,9 @@ import homeIcon from '@tabler/icons/outline/home-2.svg'; import mapPinIcon from '@tabler/icons/outline/map-pin.svg'; import roadIcon from '@tabler/icons/outline/road.svg'; -import { useAppSelector } from 'soapbox/hooks'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; -import { HStack, Icon, Stack, Text } from './ui'; +import { HStack, Icon, Stack, Text } from './ui/index.ts'; export const ADDRESS_ICONS: Record = { house: homeIcon, diff --git a/src/components/avatar-stack.tsx b/src/components/avatar-stack.tsx index 4636e3a5f..bd5339654 100644 --- a/src/components/avatar-stack.tsx +++ b/src/components/avatar-stack.tsx @@ -1,11 +1,11 @@ import clsx from 'clsx'; import { List as ImmutableList, OrderedSet as ImmutableOrderedSet } from 'immutable'; -import { Avatar, HStack } from 'soapbox/components/ui'; -import { useAppSelector } from 'soapbox/hooks'; -import { makeGetAccount } from 'soapbox/selectors'; +import { Avatar, HStack } from 'soapbox/components/ui/index.ts'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; +import { makeGetAccount } from 'soapbox/selectors/index.ts'; -import type { Account } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/types/entities.ts'; const getAccount = makeGetAccount(); diff --git a/src/components/badge.test.tsx b/src/components/badge.test.tsx index ea858fb34..b0f0cbe40 100644 --- a/src/components/badge.test.tsx +++ b/src/components/badge.test.tsx @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import Badge from './badge'; +import Badge from './badge.tsx'; describe('', () => { it('renders correctly', () => { diff --git a/src/components/badge.tsx b/src/components/badge.tsx index 8f9d6112b..a1ff9d587 100644 --- a/src/components/badge.tsx +++ b/src/components/badge.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { useMemo } from 'react'; -import { hexToHsl } from 'soapbox/utils/theme'; +import { hexToHsl } from 'soapbox/utils/theme.ts'; interface IBadge { title: React.ReactNode; diff --git a/src/components/big-card.tsx b/src/components/big-card.tsx index 06c9459ac..77c8d5585 100644 --- a/src/components/big-card.tsx +++ b/src/components/big-card.tsx @@ -1,7 +1,7 @@ import xIcon from '@tabler/icons/outline/x.svg'; -import { Card, CardBody, Stack, Text } from 'soapbox/components/ui'; -import IconButton from 'soapbox/components/ui/icon-button/icon-button'; +import IconButton from 'soapbox/components/ui/icon-button/icon-button.tsx'; +import { Card, CardBody, Stack, Text } from 'soapbox/components/ui/index.ts'; const closeIcon = xIcon; diff --git a/src/components/birthday-input.tsx b/src/components/birthday-input.tsx index bec19d1f5..634b5ef36 100644 --- a/src/components/birthday-input.tsx +++ b/src/components/birthday-input.tsx @@ -1,9 +1,9 @@ import { useMemo } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { useInstance, useFeatures } from 'soapbox/hooks'; +import { useInstance, useFeatures } from 'soapbox/hooks/index.ts'; -import { Datetime } from './ui/datetime/datetime'; +import { Datetime } from './ui/datetime/datetime.tsx'; const messages = defineMessages({ birthdayPlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birthday' }, diff --git a/src/components/birthday-panel.tsx b/src/components/birthday-panel.tsx index dd4da5d42..a4ece93be 100644 --- a/src/components/birthday-panel.tsx +++ b/src/components/birthday-panel.tsx @@ -2,10 +2,10 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import { useEffect, useRef } from 'react'; import { FormattedMessage } from 'react-intl'; -import { fetchBirthdayReminders } from 'soapbox/actions/accounts'; -import { Widget } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account-container'; -import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { fetchBirthdayReminders } from 'soapbox/actions/accounts.ts'; +import { Widget } from 'soapbox/components/ui/index.ts'; +import AccountContainer from 'soapbox/containers/account-container.tsx'; +import { useAppDispatch, useAppSelector } from 'soapbox/hooks/index.ts'; const timeToMidnight = () => { const now = new Date(); diff --git a/src/components/copyable-input.tsx b/src/components/copyable-input.tsx index 036209db7..b1ea4c926 100644 --- a/src/components/copyable-input.tsx +++ b/src/components/copyable-input.tsx @@ -1,7 +1,7 @@ import { useRef } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button, HStack, Input } from './ui'; +import { Button, HStack, Input } from './ui/index.ts'; interface ICopyableInput { /** Text to be copied. */ diff --git a/src/components/display-name-inline.tsx b/src/components/display-name-inline.tsx index 0db9fbc4b..67c75480b 100644 --- a/src/components/display-name-inline.tsx +++ b/src/components/display-name-inline.tsx @@ -1,11 +1,11 @@ -import { useSoapboxConfig } from 'soapbox/hooks'; +import { useSoapboxConfig } from 'soapbox/hooks/index.ts'; -import { getAcct } from '../utils/accounts'; +import { getAcct } from '../utils/accounts.ts'; -import { HStack, Text } from './ui'; -import VerificationBadge from './verification-badge'; +import { HStack, Text } from './ui/index.ts'; +import VerificationBadge from './verification-badge.tsx'; -import type { Account } from 'soapbox/schemas'; +import type { Account } from 'soapbox/schemas/index.ts'; interface IDisplayName { account: Pick; diff --git a/src/components/display-name.test.tsx b/src/components/display-name.test.tsx index cfc10a9ed..a9ce14e41 100644 --- a/src/components/display-name.test.tsx +++ b/src/components/display-name.test.tsx @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; -import { buildAccount } from 'soapbox/jest/factory'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { buildAccount } from 'soapbox/jest/factory.ts'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import DisplayName from './display-name'; +import DisplayName from './display-name.tsx'; describe('', () => { it('renders display name + account name', () => { diff --git a/src/components/display-name.tsx b/src/components/display-name.tsx index 36bb57c40..08abed015 100644 --- a/src/components/display-name.tsx +++ b/src/components/display-name.tsx @@ -1,12 +1,12 @@ -import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; -import { useSoapboxConfig } from 'soapbox/hooks'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper.tsx'; +import { useSoapboxConfig } from 'soapbox/hooks/index.ts'; -import { getAcct } from '../utils/accounts'; +import { getAcct } from '../utils/accounts.ts'; -import { HStack, Text } from './ui'; -import VerificationBadge from './verification-badge'; +import { HStack, Text } from './ui/index.ts'; +import VerificationBadge from './verification-badge.tsx'; -import type { Account } from 'soapbox/schemas'; +import type { Account } from 'soapbox/schemas/index.ts'; interface IDisplayName { account: Pick; diff --git a/src/components/domain.tsx b/src/components/domain.tsx index a25a2ed06..bdb4e59a2 100644 --- a/src/components/domain.tsx +++ b/src/components/domain.tsx @@ -1,10 +1,10 @@ import lockOpenIcon from '@tabler/icons/outline/lock-open.svg'; import { defineMessages, useIntl } from 'react-intl'; -import { unblockDomain } from 'soapbox/actions/domain-blocks'; -import { useAppDispatch } from 'soapbox/hooks'; +import { unblockDomain } from 'soapbox/actions/domain-blocks.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; -import { HStack, IconButton, Text } from './ui'; +import { HStack, IconButton, Text } from './ui/index.ts'; const messages = defineMessages({ blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' }, diff --git a/src/components/dropdown-menu/dropdown-menu-item.tsx b/src/components/dropdown-menu/dropdown-menu-item.tsx index 2db996589..41d17a885 100644 --- a/src/components/dropdown-menu/dropdown-menu-item.tsx +++ b/src/components/dropdown-menu/dropdown-menu-item.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import { useEffect, useRef } from 'react'; import { useHistory } from 'react-router-dom'; -import { Counter, Icon } from '../ui'; +import { Counter, Icon } from 'soapbox/components/ui/index.ts'; export interface MenuItem { action?: React.EventHandler; diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx index 59bba080d..3e9231264 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -5,16 +5,16 @@ import { supportsPassiveEvents } from 'detect-passive-events'; import { cloneElement, useEffect, useMemo, useRef, useState } from 'react'; import { useHistory } from 'react-router-dom'; -import { closeDropdownMenu as closeDropdownMenuRedux, openDropdownMenu } from 'soapbox/actions/dropdown-menu'; -import { closeModal, openModal } from 'soapbox/actions/modals'; -import { useAppDispatch } from 'soapbox/hooks'; -import { userTouching } from 'soapbox/is-mobile'; +import { closeDropdownMenu as closeDropdownMenuRedux, openDropdownMenu } from 'soapbox/actions/dropdown-menu.ts'; +import { closeModal, openModal } from 'soapbox/actions/modals.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; +import { userTouching } from 'soapbox/is-mobile.ts'; -import { IconButton, Portal } from '../ui'; +import { IconButton, Portal } from '../ui/index.ts'; -import DropdownMenuItem, { MenuItem } from './dropdown-menu-item'; +import DropdownMenuItem, { MenuItem } from './dropdown-menu-item.tsx'; -import type { Status } from 'soapbox/types/entities'; +import type { Status } from 'soapbox/types/entities.ts'; export type Menu = Array; diff --git a/src/components/dropdown-menu/index.ts b/src/components/dropdown-menu/index.ts index 014166d01..780e5b9c7 100644 --- a/src/components/dropdown-menu/index.ts +++ b/src/components/dropdown-menu/index.ts @@ -1,3 +1,3 @@ -export { default } from './dropdown-menu'; -export type { Menu } from './dropdown-menu'; -export type { MenuItem } from './dropdown-menu-item'; \ No newline at end of file +export { default } from './dropdown-menu.tsx'; +export type { Menu } from './dropdown-menu.tsx'; +export type { MenuItem } from './dropdown-menu-item.tsx'; \ No newline at end of file diff --git a/src/components/emoji-graphic.tsx b/src/components/emoji-graphic.tsx index 076133c7a..7ff4a0327 100644 --- a/src/components/emoji-graphic.tsx +++ b/src/components/emoji-graphic.tsx @@ -1,4 +1,4 @@ -import Emoji from 'soapbox/components/ui/emoji/emoji'; +import Emoji from 'soapbox/components/ui/emoji/emoji.tsx'; interface IEmojiGraphic { emoji: string; diff --git a/src/components/event-preview.tsx b/src/components/event-preview.tsx index f22d80d8a..a58407147 100644 --- a/src/components/event-preview.tsx +++ b/src/components/event-preview.tsx @@ -3,15 +3,15 @@ import userIcon from '@tabler/icons/outline/user.svg'; import clsx from 'clsx'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import EventActionButton from 'soapbox/features/event/components/event-action-button'; -import EventDate from 'soapbox/features/event/components/event-date'; -import { useAppSelector } from 'soapbox/hooks'; +import EventActionButton from 'soapbox/features/event/components/event-action-button.tsx'; +import EventDate from 'soapbox/features/event/components/event-date.tsx'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; -import Icon from './icon'; -import { Button, HStack, Stack, Text } from './ui'; -import VerificationBadge from './verification-badge'; +import Icon from './icon.tsx'; +import { Button, HStack, Stack, Text } from './ui/index.ts'; +import VerificationBadge from './verification-badge.tsx'; -import type { Status as StatusEntity } from 'soapbox/types/entities'; +import type { Status as StatusEntity } from 'soapbox/types/entities.ts'; const messages = defineMessages({ eventBanner: { id: 'event.banner', defaultMessage: 'Event banner' }, diff --git a/src/components/extended-video-player.tsx b/src/components/extended-video-player.tsx index bbab91384..ff37ce384 100644 --- a/src/components/extended-video-player.tsx +++ b/src/components/extended-video-player.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -import { isIOS } from 'soapbox/is-mobile'; +import { isIOS } from 'soapbox/is-mobile.ts'; interface IExtendedVideoPlayer { src: string; diff --git a/src/components/gdpr-banner.tsx b/src/components/gdpr-banner.tsx index 366b43359..06f5a3c6b 100644 --- a/src/components/gdpr-banner.tsx +++ b/src/components/gdpr-banner.tsx @@ -2,8 +2,8 @@ import clsx from 'clsx'; import { useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Banner, Button, HStack, Stack, Text } from 'soapbox/components/ui'; -import { useInstance, useSoapboxConfig } from 'soapbox/hooks'; +import { Banner, Button, HStack, Stack, Text } from 'soapbox/components/ui/index.ts'; +import { useInstance, useSoapboxConfig } from 'soapbox/hooks/index.ts'; const acceptedGdpr = !!localStorage.getItem('soapbox:gdpr'); diff --git a/src/components/group-card.tsx b/src/components/group-card.tsx index dc68f5c74..abcb18dac 100644 --- a/src/components/group-card.tsx +++ b/src/components/group-card.tsx @@ -1,12 +1,12 @@ -import GroupHeaderImage from 'soapbox/features/group/components/group-header-image'; -import GroupMemberCount from 'soapbox/features/group/components/group-member-count'; -import GroupPrivacy from 'soapbox/features/group/components/group-privacy'; -import GroupRelationship from 'soapbox/features/group/components/group-relationship'; +import GroupHeaderImage from 'soapbox/features/group/components/group-header-image.tsx'; +import GroupMemberCount from 'soapbox/features/group/components/group-member-count.tsx'; +import GroupPrivacy from 'soapbox/features/group/components/group-privacy.tsx'; +import GroupRelationship from 'soapbox/features/group/components/group-relationship.tsx'; -import GroupAvatar from './groups/group-avatar'; -import { HStack, Stack, Text } from './ui'; +import GroupAvatar from './groups/group-avatar.tsx'; +import { HStack, Stack, Text } from './ui/index.ts'; -import type { Group as GroupEntity } from 'soapbox/types/entities'; +import type { Group as GroupEntity } from 'soapbox/types/entities.ts'; interface IGroupCard { group: GroupEntity; diff --git a/src/components/groups/group-avatar.tsx b/src/components/groups/group-avatar.tsx index 856c63fa7..acfc92e2b 100644 --- a/src/components/groups/group-avatar.tsx +++ b/src/components/groups/group-avatar.tsx @@ -1,10 +1,9 @@ import clsx from 'clsx'; -import { GroupRoles } from 'soapbox/schemas/group-member'; +import { Avatar } from 'soapbox/components/ui/index.ts'; +import { GroupRoles } from 'soapbox/schemas/group-member.ts'; -import { Avatar } from '../ui'; - -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; interface IGroupAvatar { group: Group; diff --git a/src/components/groups/popover/group-popover.tsx b/src/components/groups/popover/group-popover.tsx index 232a37278..6a2884d80 100644 --- a/src/components/groups/popover/group-popover.tsx +++ b/src/components/groups/popover/group-popover.tsx @@ -1,13 +1,13 @@ import { defineMessages, useIntl } from 'react-intl'; import { Link, matchPath, useHistory } from 'react-router-dom'; -import { Button, Divider, HStack, Popover, Stack, Text } from 'soapbox/components/ui'; -import GroupMemberCount from 'soapbox/features/group/components/group-member-count'; -import GroupPrivacy from 'soapbox/features/group/components/group-privacy'; +import { Button, Divider, HStack, Popover, Stack, Text } from 'soapbox/components/ui/index.ts'; +import GroupMemberCount from 'soapbox/features/group/components/group-member-count.tsx'; +import GroupPrivacy from 'soapbox/features/group/components/group-privacy.tsx'; -import GroupAvatar from '../group-avatar'; +import GroupAvatar from '../group-avatar.tsx'; -import type { Group } from 'soapbox/schemas'; +import type { Group } from 'soapbox/schemas/index.ts'; interface IGroupPopoverContainer { children: React.ReactElement>; diff --git a/src/components/hashtag-link.tsx b/src/components/hashtag-link.tsx index 420f8f33a..9f1437e03 100644 --- a/src/components/hashtag-link.tsx +++ b/src/components/hashtag-link.tsx @@ -1,4 +1,4 @@ -import Link from './link'; +import Link from './link.tsx'; interface IHashtagLink { hashtag: string; diff --git a/src/components/hashtag.tsx b/src/components/hashtag.tsx index 098993c1c..d8475baaa 100644 --- a/src/components/hashtag.tsx +++ b/src/components/hashtag.tsx @@ -2,11 +2,11 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { Sparklines, SparklinesCurve } from 'react-sparklines'; -import { shortNumberFormat } from '../utils/numbers'; +import { shortNumberFormat } from '../utils/numbers.tsx'; -import { HStack, Stack, Text } from './ui'; +import { HStack, Stack, Text } from './ui/index.ts'; -import type { Tag } from 'soapbox/types/entities'; +import type { Tag } from 'soapbox/types/entities.ts'; interface IHashtag { hashtag: Tag; diff --git a/src/components/helmet.tsx b/src/components/helmet.tsx index 0412bb6d5..286ad79dd 100644 --- a/src/components/helmet.tsx +++ b/src/components/helmet.tsx @@ -1,10 +1,10 @@ import { useMemo, useEffect } from 'react'; import { Helmet as ReactHelmet } from 'react-helmet'; -import { useStatContext } from 'soapbox/contexts/stat-context'; -import { useAppSelector, useInstance, useSettings } from 'soapbox/hooks'; -import { RootState } from 'soapbox/store'; -import FaviconService from 'soapbox/utils/favicon-service'; +import { useStatContext } from 'soapbox/contexts/stat-context.tsx'; +import { useAppSelector, useInstance, useSettings } from 'soapbox/hooks/index.ts'; +import { RootState } from 'soapbox/store.ts'; +import FaviconService from 'soapbox/utils/favicon-service.ts'; FaviconService.initFaviconService(); diff --git a/src/components/hover-ref-wrapper.tsx b/src/components/hover-ref-wrapper.tsx index d822d1b0c..4e175533b 100644 --- a/src/components/hover-ref-wrapper.tsx +++ b/src/components/hover-ref-wrapper.tsx @@ -2,13 +2,13 @@ import clsx from 'clsx'; import debounce from 'lodash/debounce'; import { useRef } from 'react'; -import { fetchAccount } from 'soapbox/actions/accounts'; +import { fetchAccount } from 'soapbox/actions/accounts.ts'; import { openProfileHoverCard, closeProfileHoverCard, -} from 'soapbox/actions/profile-hover-card'; -import { useAppDispatch } from 'soapbox/hooks'; -import { isMobile } from 'soapbox/is-mobile'; +} from 'soapbox/actions/profile-hover-card.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; +import { isMobile } from 'soapbox/is-mobile.ts'; const showProfileHoverCard = debounce((dispatch, ref, accountId) => { dispatch(openProfileHoverCard(ref, accountId)); diff --git a/src/components/hover-status-wrapper.tsx b/src/components/hover-status-wrapper.tsx index 5f6ff4420..bc3b5cab1 100644 --- a/src/components/hover-status-wrapper.tsx +++ b/src/components/hover-status-wrapper.tsx @@ -6,8 +6,8 @@ import { useDispatch } from 'react-redux'; import { openStatusHoverCard, closeStatusHoverCard, -} from 'soapbox/actions/status-hover-card'; -import { isMobile } from 'soapbox/is-mobile'; +} from 'soapbox/actions/status-hover-card.ts'; +import { isMobile } from 'soapbox/is-mobile.ts'; const showStatusHoverCard = debounce((dispatch, ref, statusId) => { dispatch(openStatusHoverCard(ref, statusId)); diff --git a/src/components/icon-button.tsx b/src/components/icon-button.tsx index 0cd96dec1..fea0c49f5 100644 --- a/src/components/icon-button.tsx +++ b/src/components/icon-button.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; -import Icon from 'soapbox/components/icon'; +import Icon from 'soapbox/components/icon.tsx'; interface IIconButton extends Pick, 'className' | 'disabled' | 'onClick' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave' | 'tabIndex' | 'title'> { active?: boolean; diff --git a/src/components/icon-with-counter.tsx b/src/components/icon-with-counter.tsx index ae77c5a93..7ccf29234 100644 --- a/src/components/icon-with-counter.tsx +++ b/src/components/icon-with-counter.tsx @@ -1,5 +1,5 @@ -import Icon, { IIcon } from 'soapbox/components/icon'; -import { Counter } from 'soapbox/components/ui'; +import Icon, { IIcon } from 'soapbox/components/icon.tsx'; +import { Counter } from 'soapbox/components/ui/index.ts'; interface IIconWithCounter extends React.HTMLAttributes { count: number; diff --git a/src/components/list.tsx b/src/components/list.tsx index 20d662345..3f0567c9e 100644 --- a/src/components/list.tsx +++ b/src/components/list.tsx @@ -4,9 +4,9 @@ import clsx from 'clsx'; import { Children, cloneElement, isValidElement, useCallback } from 'react'; import { Link } from 'react-router-dom'; -import { SelectDropdown } from '../features/forms'; +import { SelectDropdown } from '../features/forms/index.tsx'; -import { Icon, HStack, Select } from './ui'; +import { Icon, HStack, Select } from './ui/index.ts'; interface IList { children: React.ReactNode; diff --git a/src/components/load-gap.tsx b/src/components/load-gap.tsx index 2be5f19d9..8df07f224 100644 --- a/src/components/load-gap.tsx +++ b/src/components/load-gap.tsx @@ -1,7 +1,7 @@ import dotsIcon from '@tabler/icons/outline/dots.svg'; import { defineMessages, useIntl } from 'react-intl'; -import Icon from 'soapbox/components/icon'; +import Icon from 'soapbox/components/icon.tsx'; const messages = defineMessages({ load_more: { id: 'status.load_more', defaultMessage: 'Load more' }, diff --git a/src/components/load-more.tsx b/src/components/load-more.tsx index 359f948df..354c445ea 100644 --- a/src/components/load-more.tsx +++ b/src/components/load-more.tsx @@ -1,6 +1,6 @@ import { FormattedMessage } from 'react-intl'; -import { Button } from 'soapbox/components/ui'; +import { Button } from 'soapbox/components/ui/index.ts'; interface ILoadMore { onClick: React.MouseEventHandler; diff --git a/src/components/loading-screen.tsx b/src/components/loading-screen.tsx index d3c76043e..248e3bbd3 100644 --- a/src/components/loading-screen.tsx +++ b/src/components/loading-screen.tsx @@ -1,5 +1,5 @@ -import LandingGradient from 'soapbox/components/landing-gradient'; -import { Spinner } from 'soapbox/components/ui'; +import LandingGradient from 'soapbox/components/landing-gradient.tsx'; +import { Spinner } from 'soapbox/components/ui/index.ts'; /** Fullscreen loading indicator. */ const LoadingScreen: React.FC = () => { diff --git a/src/components/location-search.tsx b/src/components/location-search.tsx index 2415c91c0..ca476f8a3 100644 --- a/src/components/location-search.tsx +++ b/src/components/location-search.tsx @@ -6,12 +6,12 @@ import throttle from 'lodash/throttle'; import { useCallback, useEffect, useRef, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { locationSearch } from 'soapbox/actions/events'; -import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input'; -import Icon from 'soapbox/components/icon'; -import { useAppDispatch } from 'soapbox/hooks'; +import { locationSearch } from 'soapbox/actions/events.ts'; +import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input.tsx'; +import Icon from 'soapbox/components/icon.tsx'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; -import AutosuggestLocation from './autosuggest-location'; +import AutosuggestLocation from './autosuggest-location.tsx'; const noOp = () => {}; diff --git a/src/components/markup.tsx b/src/components/markup.tsx index bdc91700b..19901d0b5 100644 --- a/src/components/markup.tsx +++ b/src/components/markup.tsx @@ -1,6 +1,6 @@ import { forwardRef } from 'react'; -import Text, { IText } from './ui/text/text'; +import Text, { IText } from './ui/text/text.tsx'; import './markup.css'; interface IMarkup extends IText { diff --git a/src/components/media-gallery.tsx b/src/components/media-gallery.tsx index 5f6273037..3beebbb22 100644 --- a/src/components/media-gallery.tsx +++ b/src/components/media-gallery.tsx @@ -3,17 +3,17 @@ import volumeIcon from '@tabler/icons/outline/volume.svg'; import clsx from 'clsx'; import { useState, useRef, useLayoutEffect, CSSProperties } from 'react'; -import Blurhash from 'soapbox/components/blurhash'; -import StillImage from 'soapbox/components/still-image'; -import { MIMETYPE_ICONS } from 'soapbox/components/upload'; -import { useSettings, useSoapboxConfig } from 'soapbox/hooks'; -import { Attachment } from 'soapbox/types/entities'; -import { truncateFilename } from 'soapbox/utils/media'; +import Blurhash from 'soapbox/components/blurhash.tsx'; +import StillImage from 'soapbox/components/still-image.tsx'; +import { MIMETYPE_ICONS } from 'soapbox/components/upload.tsx'; +import { useSettings, useSoapboxConfig } from 'soapbox/hooks/index.ts'; +import { Attachment } from 'soapbox/types/entities.ts'; +import { truncateFilename } from 'soapbox/utils/media.ts'; -import { isIOS } from '../is-mobile'; -import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio'; +import { isIOS } from '../is-mobile.ts'; +import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio.ts'; -import SvgIcon from './ui/icon/svg-icon'; +import SvgIcon from './ui/icon/svg-icon.tsx'; import type { List as ImmutableList } from 'immutable'; diff --git a/src/components/mention.tsx b/src/components/mention.tsx index ffb024256..c6fe5f251 100644 --- a/src/components/mention.tsx +++ b/src/components/mention.tsx @@ -1,10 +1,10 @@ import { Link } from 'react-router-dom'; -import { shortenNostr } from 'soapbox/utils/nostr'; +import { shortenNostr } from 'soapbox/utils/nostr.ts'; -import { Tooltip } from './ui'; +import { Tooltip } from './ui/index.ts'; -import type { Mention as MentionEntity } from 'soapbox/schemas'; +import type { Mention as MentionEntity } from 'soapbox/schemas/index.ts'; interface IMention { mention: Pick; diff --git a/src/components/missing-indicator.tsx b/src/components/missing-indicator.tsx index 7ff67dd23..caeab19d3 100644 --- a/src/components/missing-indicator.tsx +++ b/src/components/missing-indicator.tsx @@ -1,6 +1,6 @@ import { FormattedMessage } from 'react-intl'; -import { Card, CardBody, Stack, Text } from './ui'; +import { Card, CardBody, Stack, Text } from './ui/index.ts'; interface MissingIndicatorProps { nested?: boolean; diff --git a/src/components/modal-root.tsx b/src/components/modal-root.tsx index 1b4ab3278..31388efd0 100644 --- a/src/components/modal-root.tsx +++ b/src/components/modal-root.tsx @@ -4,14 +4,14 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; -import { cancelReplyCompose } from 'soapbox/actions/compose'; -import { cancelEventCompose } from 'soapbox/actions/events'; -import { openModal, closeModal } from 'soapbox/actions/modals'; -import { useAppDispatch, usePrevious } from 'soapbox/hooks'; +import { cancelReplyCompose } from 'soapbox/actions/compose.ts'; +import { cancelEventCompose } from 'soapbox/actions/events.ts'; +import { openModal, closeModal } from 'soapbox/actions/modals.ts'; +import { useAppDispatch, usePrevious } from 'soapbox/hooks/index.ts'; -import type { ModalType } from 'soapbox/features/ui/components/modal-root'; -import type { ReducerCompose } from 'soapbox/reducers/compose'; -import type { ReducerRecord as ReducerComposeEvent } from 'soapbox/reducers/compose-event'; +import type { ModalType } from 'soapbox/features/ui/components/modal-root.tsx'; +import type { ReducerRecord as ReducerComposeEvent } from 'soapbox/reducers/compose-event.ts'; +import type { ReducerCompose } from 'soapbox/reducers/compose.ts'; const messages = defineMessages({ confirm: { id: 'confirmations.cancel.confirm', defaultMessage: 'Discard' }, diff --git a/src/components/navlinks.tsx b/src/components/navlinks.tsx index 81aa37ad5..560aa9988 100644 --- a/src/components/navlinks.tsx +++ b/src/components/navlinks.tsx @@ -1,7 +1,7 @@ import { Link } from 'react-router-dom'; -import { Text } from 'soapbox/components/ui'; -import { useSettings, useSoapboxConfig } from 'soapbox/hooks'; +import { Text } from 'soapbox/components/ui/index.ts'; +import { useSettings, useSoapboxConfig } from 'soapbox/hooks/index.ts'; interface INavlinks { type: string; diff --git a/src/components/pending-items-row.tsx b/src/components/pending-items-row.tsx index 5fc0a7637..5381ddc39 100644 --- a/src/components/pending-items-row.tsx +++ b/src/components/pending-items-row.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; -import { HStack, Icon, Text } from 'soapbox/components/ui'; +import { HStack, Icon, Text } from 'soapbox/components/ui/index.ts'; interface IPendingItemsRow { /** Path to navigate the user when clicked. */ diff --git a/src/components/polls/poll-footer.test.tsx b/src/components/polls/poll-footer.test.tsx index 39dd4ba18..38c0761b9 100644 --- a/src/components/polls/poll-footer.test.tsx +++ b/src/components/polls/poll-footer.test.tsx @@ -3,11 +3,11 @@ import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; import { beforeEach, describe, expect, it } from 'vitest'; -import { __stub } from 'soapbox/api'; -import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers'; -import { type Poll } from 'soapbox/schemas'; +import { __stub } from 'soapbox/api/index.ts'; +import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { type Poll } from 'soapbox/schemas/index.ts'; -import PollFooter from './poll-footer'; +import PollFooter from './poll-footer.tsx'; let poll: Poll = { id: '1', diff --git a/src/components/polls/poll-footer.tsx b/src/components/polls/poll-footer.tsx index 827bb8128..c00789099 100644 --- a/src/components/polls/poll-footer.tsx +++ b/src/components/polls/poll-footer.tsx @@ -1,12 +1,11 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import { fetchPoll, vote } from 'soapbox/actions/polls'; -import { useAppDispatch } from 'soapbox/hooks'; +import { fetchPoll, vote } from 'soapbox/actions/polls.ts'; +import RelativeTimestamp from 'soapbox/components/relative-timestamp.tsx'; +import { Button, HStack, Stack, Text, Tooltip } from 'soapbox/components/ui/index.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; -import RelativeTimestamp from '../relative-timestamp'; -import { Button, HStack, Stack, Text, Tooltip } from '../ui'; - -import type { Poll as PollEntity } from 'soapbox/types/entities'; +import type { Poll as PollEntity } from 'soapbox/types/entities.ts'; const messages = defineMessages({ closed: { id: 'poll.closed', defaultMessage: 'Closed' }, diff --git a/src/components/polls/poll-option.tsx b/src/components/polls/poll-option.tsx index 049960750..6064e2ba6 100644 --- a/src/components/polls/poll-option.tsx +++ b/src/components/polls/poll-option.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx'; import { defineMessages, useIntl } from 'react-intl'; import { Motion, presets, spring } from 'react-motion'; -import { HStack, Icon, Text } from '../ui'; +import { HStack, Icon, Text } from 'soapbox/components/ui/index.ts'; import type { Poll as PollEntity, diff --git a/src/components/polls/poll.tsx b/src/components/polls/poll.tsx index add1c349f..8895b0a16 100644 --- a/src/components/polls/poll.tsx +++ b/src/components/polls/poll.tsx @@ -1,14 +1,13 @@ import { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { openModal } from 'soapbox/actions/modals'; -import { vote } from 'soapbox/actions/polls'; -import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { vote } from 'soapbox/actions/polls.ts'; +import { Stack, Text } from 'soapbox/components/ui/index.ts'; +import { useAppDispatch, useAppSelector } from 'soapbox/hooks/index.ts'; -import { Stack, Text } from '../ui'; - -import PollFooter from './poll-footer'; -import PollOption from './poll-option'; +import PollFooter from './poll-footer.tsx'; +import PollOption from './poll-option.tsx'; interface IPoll { id: string; diff --git a/src/components/preview-card.tsx b/src/components/preview-card.tsx index 445678c27..d579d7cd6 100644 --- a/src/components/preview-card.tsx +++ b/src/components/preview-card.tsx @@ -6,13 +6,13 @@ import clsx from 'clsx'; import { List as ImmutableList } from 'immutable'; import { useState, useEffect } from 'react'; -import Blurhash from 'soapbox/components/blurhash'; -import { HStack, Stack, Text, Icon } from 'soapbox/components/ui'; -import { normalizeAttachment } from 'soapbox/normalizers'; -import { addAutoPlay } from 'soapbox/utils/media'; -import { getTextDirection } from 'soapbox/utils/rtl'; +import Blurhash from 'soapbox/components/blurhash.tsx'; +import { HStack, Stack, Text, Icon } from 'soapbox/components/ui/index.ts'; +import { normalizeAttachment } from 'soapbox/normalizers/index.ts'; +import { addAutoPlay } from 'soapbox/utils/media.ts'; +import { getTextDirection } from 'soapbox/utils/rtl.ts'; -import type { Card as CardEntity, Attachment } from 'soapbox/types/entities'; +import type { Card as CardEntity, Attachment } from 'soapbox/types/entities.ts'; /** Props for `PreviewCard`. */ interface IPreviewCard { diff --git a/src/components/profile-hover-card.tsx b/src/components/profile-hover-card.tsx index 01039de16..23b6191a2 100644 --- a/src/components/profile-hover-card.tsx +++ b/src/components/profile-hover-card.tsx @@ -5,23 +5,24 @@ import { useEffect, useState } from 'react'; import { useIntl, FormattedMessage } from 'react-intl'; import { useHistory } from 'react-router-dom'; -import { fetchRelationships } from 'soapbox/actions/accounts'; + +import { fetchRelationships } from 'soapbox/actions/accounts.ts'; import { closeProfileHoverCard, updateProfileHoverCard, -} from 'soapbox/actions/profile-hover-card'; -import { useAccount, usePatronUser } from 'soapbox/api/hooks'; -import Badge from 'soapbox/components/badge'; -import ActionButton from 'soapbox/features/ui/components/action-button'; -import { UserPanel } from 'soapbox/features/ui/util/async-components'; -import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; +} from 'soapbox/actions/profile-hover-card.ts'; +import { useAccount, usePatronUser } from 'soapbox/api/hooks/index.ts'; +import Badge from 'soapbox/components/badge.tsx'; +import ActionButton from 'soapbox/features/ui/components/action-button.tsx'; +import { UserPanel } from 'soapbox/features/ui/util/async-components.ts'; +import { useAppSelector, useAppDispatch } from 'soapbox/hooks/index.ts'; -import { showProfileHoverCard } from './hover-ref-wrapper'; -import { dateFormatOptions } from './relative-timestamp'; -import { Card, CardBody, HStack, Icon, Stack, Text } from './ui'; +import { showProfileHoverCard } from './hover-ref-wrapper.tsx'; +import { dateFormatOptions } from './relative-timestamp.tsx'; +import { Card, CardBody, HStack, Icon, Stack, Text } from './ui/index.ts'; -import type { Account, PatronUser } from 'soapbox/schemas'; -import type { AppDispatch } from 'soapbox/store'; +import type { Account, PatronUser } from 'soapbox/schemas/index.ts'; +import type { AppDispatch } from 'soapbox/store.ts'; const getBadges = ( account?: Pick, diff --git a/src/components/pull-to-refresh.tsx b/src/components/pull-to-refresh.tsx index 45e6fe443..39642ce39 100644 --- a/src/components/pull-to-refresh.tsx +++ b/src/components/pull-to-refresh.tsx @@ -1,6 +1,6 @@ import PTRComponent from 'react-simple-pull-to-refresh'; -import { Spinner } from 'soapbox/components/ui'; +import { Spinner } from 'soapbox/components/ui/index.ts'; interface IPullToRefresh { onRefresh?: () => Promise; diff --git a/src/components/pullable.tsx b/src/components/pullable.tsx index d04eb00ef..d98a3158d 100644 --- a/src/components/pullable.tsx +++ b/src/components/pullable.tsx @@ -1,4 +1,4 @@ -import PullToRefresh from './pull-to-refresh'; +import PullToRefresh from './pull-to-refresh.tsx'; interface IPullable { children: React.ReactNode; diff --git a/src/components/quoted-status-indicator.tsx b/src/components/quoted-status-indicator.tsx index b310fd358..d761e1da6 100644 --- a/src/components/quoted-status-indicator.tsx +++ b/src/components/quoted-status-indicator.tsx @@ -1,9 +1,9 @@ import quoteIcon from '@tabler/icons/outline/quote.svg'; import { useCallback } from 'react'; -import { HStack, Icon, Text } from 'soapbox/components/ui'; -import { useAppSelector } from 'soapbox/hooks'; -import { makeGetStatus } from 'soapbox/selectors'; +import { HStack, Icon, Text } from 'soapbox/components/ui/index.ts'; +import { useAppSelector } from 'soapbox/hooks/index.ts'; +import { makeGetStatus } from 'soapbox/selectors/index.ts'; interface IQuotedStatusIndicator { /** The quoted status id. */ diff --git a/src/components/quoted-status.test.tsx b/src/components/quoted-status.test.tsx index 6f29e8748..49dde1a8e 100644 --- a/src/components/quoted-status.test.tsx +++ b/src/components/quoted-status.test.tsx @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest'; -import { render, screen, rootState } from 'soapbox/jest/test-helpers'; -import { normalizeStatus, normalizeAccount } from 'soapbox/normalizers'; +import { render, screen, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeStatus, normalizeAccount } from 'soapbox/normalizers/index.ts'; -import QuotedStatus from './quoted-status'; +import QuotedStatus from './quoted-status.tsx'; -import type { ReducerStatus } from 'soapbox/reducers/statuses'; +import type { ReducerStatus } from 'soapbox/reducers/statuses.ts'; describe('', () => { it('renders content', () => { diff --git a/src/components/quoted-status.tsx b/src/components/quoted-status.tsx index 42a84a238..654c016c5 100644 --- a/src/components/quoted-status.tsx +++ b/src/components/quoted-status.tsx @@ -4,20 +4,20 @@ import { MouseEventHandler, useEffect, useRef, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; -import StatusMedia from 'soapbox/components/status-media'; -import { Stack } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account-container'; -import { useSettings } from 'soapbox/hooks'; -import { defaultMediaVisibility } from 'soapbox/utils/status'; +import StatusMedia from 'soapbox/components/status-media.tsx'; +import { Stack } from 'soapbox/components/ui/index.ts'; +import AccountContainer from 'soapbox/containers/account-container.tsx'; +import { useSettings } from 'soapbox/hooks/index.ts'; +import { defaultMediaVisibility } from 'soapbox/utils/status.ts'; -import EventPreview from './event-preview'; -import OutlineBox from './outline-box'; -import QuotedStatusIndicator from './quoted-status-indicator'; -import StatusContent from './status-content'; -import StatusReplyMentions from './status-reply-mentions'; -import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; +import EventPreview from './event-preview.tsx'; +import OutlineBox from './outline-box.tsx'; +import QuotedStatusIndicator from './quoted-status-indicator.tsx'; +import StatusContent from './status-content.tsx'; +import StatusReplyMentions from './status-reply-mentions.tsx'; +import SensitiveContentOverlay from './statuses/sensitive-content-overlay.tsx'; -import type { Status as StatusEntity } from 'soapbox/types/entities'; +import type { Status as StatusEntity } from 'soapbox/types/entities.ts'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, diff --git a/src/components/radio.tsx b/src/components/radio.tsx index d17920ffa..806bc8a8e 100644 --- a/src/components/radio.tsx +++ b/src/components/radio.tsx @@ -1,6 +1,6 @@ import { Children, cloneElement } from 'react'; -import List, { ListItem } from './list'; +import List, { ListItem } from './list.tsx'; interface IRadioGroup { onChange: React.ChangeEventHandler; diff --git a/src/components/relative-timestamp.tsx b/src/components/relative-timestamp.tsx index a1ea72123..27633fd3f 100644 --- a/src/components/relative-timestamp.tsx +++ b/src/components/relative-timestamp.tsx @@ -1,7 +1,7 @@ import { Component } from 'react'; import { injectIntl, defineMessages, IntlShape, FormatDateOptions } from 'react-intl'; -import Text, { IText } from './ui/text/text'; +import Text, { IText } from './ui/text/text.tsx'; const messages = defineMessages({ just_now: { id: 'relative_time.just_now', defaultMessage: 'now' }, diff --git a/src/components/scroll-top-button.test.tsx b/src/components/scroll-top-button.test.tsx index 387e9c843..0acba26fb 100644 --- a/src/components/scroll-top-button.test.tsx +++ b/src/components/scroll-top-button.test.tsx @@ -1,9 +1,9 @@ import { defineMessages } from 'react-intl'; import { describe, expect, it } from 'vitest'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import ScrollTopButton from './scroll-top-button'; +import ScrollTopButton from './scroll-top-button.tsx'; const messages = defineMessages({ queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' }, diff --git a/src/components/scroll-top-button.tsx b/src/components/scroll-top-button.tsx index 5e564aa2d..b74c98d8d 100644 --- a/src/components/scroll-top-button.tsx +++ b/src/components/scroll-top-button.tsx @@ -3,8 +3,8 @@ import throttle from 'lodash/throttle'; import { useState, useEffect, useCallback } from 'react'; import { useIntl, MessageDescriptor } from 'react-intl'; -import { Icon, Text } from 'soapbox/components/ui'; -import { useSettings } from 'soapbox/hooks'; +import { Icon, Text } from 'soapbox/components/ui/index.ts'; +import { useSettings } from 'soapbox/hooks/index.ts'; interface IScrollTopButton { /** Callback when clicked, and also when scrolled to the top. */ diff --git a/src/components/scrollable-list.tsx b/src/components/scrollable-list.tsx index 33ccb52ad..254e66c5b 100644 --- a/src/components/scrollable-list.tsx +++ b/src/components/scrollable-list.tsx @@ -3,10 +3,10 @@ import { useEffect, useRef, useMemo, useCallback, forwardRef } from 'react'; import { useHistory } from 'react-router-dom'; import { Virtuoso, Components, VirtuosoProps, VirtuosoHandle, ListRange, IndexLocationWithAlign } from 'react-virtuoso'; -import { useSettings } from 'soapbox/hooks'; +import { useSettings } from 'soapbox/hooks/index.ts'; -import LoadMore from './load-more'; -import { Card, Spinner } from './ui'; +import LoadMore from './load-more.tsx'; +import { Card, Spinner } from './ui/index.ts'; /** Custom Viruoso component context. */ type Context = { diff --git a/src/components/sentry-feedback-form.tsx b/src/components/sentry-feedback-form.tsx index 07dee7f79..559417119 100644 --- a/src/components/sentry-feedback-form.tsx +++ b/src/components/sentry-feedback-form.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Textarea, Form, Button, FormGroup, FormActions, Text } from 'soapbox/components/ui'; -import { useOwnAccount } from 'soapbox/hooks'; -import { captureSentryFeedback } from 'soapbox/sentry'; +import { Textarea, Form, Button, FormGroup, FormActions, Text } from 'soapbox/components/ui/index.ts'; +import { useOwnAccount } from 'soapbox/hooks/index.ts'; +import { captureSentryFeedback } from 'soapbox/sentry.ts'; interface ISentryFeedbackForm { eventId: string; diff --git a/src/components/sidebar-menu.tsx b/src/components/sidebar-menu.tsx index bf2dc3108..e2648f53a 100644 --- a/src/components/sidebar-menu.tsx +++ b/src/components/sidebar-menu.tsx @@ -21,18 +21,18 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { Link, NavLink } from 'react-router-dom'; -import { fetchOwnAccounts, logOut, switchAccount } from 'soapbox/actions/auth'; -import { getSettings } from 'soapbox/actions/settings'; -import { closeSidebar } from 'soapbox/actions/sidebar'; -import { useAccount } from 'soapbox/api/hooks'; -import Account from 'soapbox/components/account'; -import { Stack, Divider, HStack, Icon, IconButton, Text } from 'soapbox/components/ui'; -import ProfileStats from 'soapbox/features/ui/components/profile-stats'; -import { useAppDispatch, useAppSelector, useFeatures, useInstance } from 'soapbox/hooks'; -import { useSettingsNotifications } from 'soapbox/hooks/useSettingsNotifications'; -import { makeGetOtherAccounts } from 'soapbox/selectors'; +import { fetchOwnAccounts, logOut, switchAccount } from 'soapbox/actions/auth.ts'; +import { getSettings } from 'soapbox/actions/settings.ts'; +import { closeSidebar } from 'soapbox/actions/sidebar.ts'; +import { useAccount } from 'soapbox/api/hooks/index.ts'; +import Account from 'soapbox/components/account.tsx'; +import { Stack, Divider, HStack, Icon, IconButton, Text } from 'soapbox/components/ui/index.ts'; +import ProfileStats from 'soapbox/features/ui/components/profile-stats.tsx'; +import { useAppDispatch, useAppSelector, useFeatures, useInstance } from 'soapbox/hooks/index.ts'; +import { useSettingsNotifications } from 'soapbox/hooks/useSettingsNotifications.ts'; +import { makeGetOtherAccounts } from 'soapbox/selectors/index.ts'; -import type { Account as AccountEntity } from 'soapbox/schemas/account'; +import type { Account as AccountEntity } from 'soapbox/schemas/account.ts'; const messages = defineMessages({ followers: { id: 'account.followers', defaultMessage: 'Followers' }, diff --git a/src/components/sidebar-navigation-link.tsx b/src/components/sidebar-navigation-link.tsx index 944985704..0b3ec8ded 100644 --- a/src/components/sidebar-navigation-link.tsx +++ b/src/components/sidebar-navigation-link.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import { forwardRef } from 'react'; import { NavLink, useLocation } from 'react-router-dom'; -import { Icon, Text } from './ui'; +import { Icon, Text } from './ui/index.ts'; interface ISidebarNavigationLink { /** Notification count, if any. */ diff --git a/src/components/sidebar-navigation.tsx b/src/components/sidebar-navigation.tsx index 68783d639..3045c64e7 100644 --- a/src/components/sidebar-navigation.tsx +++ b/src/components/sidebar-navigation.tsx @@ -22,14 +22,14 @@ import userIcon from '@tabler/icons/outline/user.svg'; import worldIcon from '@tabler/icons/outline/world.svg'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import { Stack } from 'soapbox/components/ui'; -import { useStatContext } from 'soapbox/contexts/stat-context'; -import ComposeButton from 'soapbox/features/ui/components/compose-button'; -import { useAppSelector, useFeatures, useOwnAccount, useSettings, useInstance } from 'soapbox/hooks'; -import { useSettingsNotifications } from 'soapbox/hooks/useSettingsNotifications'; +import { Stack } from 'soapbox/components/ui/index.ts'; +import { useStatContext } from 'soapbox/contexts/stat-context.tsx'; +import ComposeButton from 'soapbox/features/ui/components/compose-button.tsx'; +import { useAppSelector, useFeatures, useOwnAccount, useSettings, useInstance } from 'soapbox/hooks/index.ts'; +import { useSettingsNotifications } from 'soapbox/hooks/useSettingsNotifications.ts'; -import DropdownMenu, { Menu } from './dropdown-menu'; -import SidebarNavigationLink from './sidebar-navigation-link'; +import DropdownMenu, { Menu } from './dropdown-menu/index.ts'; +import SidebarNavigationLink from './sidebar-navigation-link.tsx'; const messages = defineMessages({ follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, diff --git a/src/components/site-error-boundary.tsx b/src/components/site-error-boundary.tsx index 27b99dd1d..489efe91b 100644 --- a/src/components/site-error-boundary.tsx +++ b/src/components/site-error-boundary.tsx @@ -2,16 +2,16 @@ import { type ErrorInfo, useRef, useState } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { FormattedMessage } from 'react-intl'; -import { NODE_ENV } from 'soapbox/build-config'; -import { HStack, Text, Stack, Textarea } from 'soapbox/components/ui'; -import { useSoapboxConfig } from 'soapbox/hooks'; -import { captureSentryException } from 'soapbox/sentry'; -import KVStore from 'soapbox/storage/kv-store'; -import sourceCode from 'soapbox/utils/code'; -import { unregisterSW } from 'soapbox/utils/sw'; +import { NODE_ENV } from 'soapbox/build-config.ts'; +import { HStack, Text, Stack, Textarea } from 'soapbox/components/ui/index.ts'; +import { useSoapboxConfig } from 'soapbox/hooks/index.ts'; +import { captureSentryException } from 'soapbox/sentry.ts'; +import KVStore from 'soapbox/storage/kv-store.ts'; +import sourceCode from 'soapbox/utils/code.ts'; +import { unregisterSW } from 'soapbox/utils/sw.ts'; -import SentryFeedbackForm from './sentry-feedback-form'; -import SiteLogo from './site-logo'; +import SentryFeedbackForm from './sentry-feedback-form.tsx'; +import SiteLogo from './site-logo.tsx'; interface ISiteErrorBoundary { children: React.ReactNode; diff --git a/src/components/site-logo.tsx b/src/components/site-logo.tsx index 9a21043a9..4b1ebc323 100644 --- a/src/components/site-logo.tsx +++ b/src/components/site-logo.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import soapboxLogoWhiteSrc from 'soapbox/assets/images/soapbox-logo-white.svg'; import soapboxLogoSrc from 'soapbox/assets/images/soapbox-logo.svg'; -import { useSoapboxConfig, useSettings, useTheme } from 'soapbox/hooks'; +import { useSoapboxConfig, useSettings, useTheme } from 'soapbox/hooks/index.ts'; interface ISiteLogo extends React.ComponentProps<'img'> { /** Extra class names for the element. */ diff --git a/src/components/status-action-bar.tsx b/src/components/status-action-bar.tsx index e80cd1993..77202324a 100644 --- a/src/components/status-action-bar.tsx +++ b/src/components/status-action-bar.tsx @@ -33,33 +33,33 @@ import volume3Icon from '@tabler/icons/outline/volume-3.svg'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useHistory, useRouteMatch } from 'react-router-dom'; -import { blockAccount } from 'soapbox/actions/accounts'; -import { launchChat } from 'soapbox/actions/chats'; -import { directCompose, mentionCompose, quoteCompose, replyCompose } from 'soapbox/actions/compose'; -import { editEvent } from 'soapbox/actions/events'; -import { pinToGroup, toggleBookmark, toggleDislike, toggleFavourite, togglePin, toggleReblog, unpinFromGroup } from 'soapbox/actions/interactions'; -import { openModal } from 'soapbox/actions/modals'; -import { deleteStatusModal, toggleStatusSensitivityModal } from 'soapbox/actions/moderation'; -import { initMuteModal } from 'soapbox/actions/mutes'; -import { initReport, ReportableEntities } from 'soapbox/actions/reports'; -import { deleteStatus, editStatus, toggleMuteStatus } from 'soapbox/actions/statuses'; -import { deleteFromTimelines } from 'soapbox/actions/timelines'; -import { useBlockGroupMember, useGroup, useGroupRelationship, useMuteGroup, useUnmuteGroup } from 'soapbox/api/hooks'; -import { useDeleteGroupStatus } from 'soapbox/api/hooks/groups/useDeleteGroupStatus'; -import DropdownMenu from 'soapbox/components/dropdown-menu'; -import StatusActionButton from 'soapbox/components/status-action-button'; -import StatusReactionWrapper from 'soapbox/components/status-reaction-wrapper'; -import { HStack } from 'soapbox/components/ui'; -import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks'; -import { GroupRoles } from 'soapbox/schemas/group-member'; -import toast from 'soapbox/toast'; -import copy from 'soapbox/utils/copy'; -import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji-reacts'; +import { blockAccount } from 'soapbox/actions/accounts.ts'; +import { launchChat } from 'soapbox/actions/chats.ts'; +import { directCompose, mentionCompose, quoteCompose, replyCompose } from 'soapbox/actions/compose.ts'; +import { editEvent } from 'soapbox/actions/events.ts'; +import { pinToGroup, toggleBookmark, toggleDislike, toggleFavourite, togglePin, toggleReblog, unpinFromGroup } from 'soapbox/actions/interactions.ts'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { deleteStatusModal, toggleStatusSensitivityModal } from 'soapbox/actions/moderation.tsx'; +import { initMuteModal } from 'soapbox/actions/mutes.ts'; +import { initReport, ReportableEntities } from 'soapbox/actions/reports.ts'; +import { deleteStatus, editStatus, toggleMuteStatus } from 'soapbox/actions/statuses.ts'; +import { deleteFromTimelines } from 'soapbox/actions/timelines.ts'; +import { useDeleteGroupStatus } from 'soapbox/api/hooks/groups/useDeleteGroupStatus.ts'; +import { useBlockGroupMember, useGroup, useGroupRelationship, useMuteGroup, useUnmuteGroup } from 'soapbox/api/hooks/index.ts'; +import DropdownMenu from 'soapbox/components/dropdown-menu/index.ts'; +import StatusActionButton from 'soapbox/components/status-action-button.tsx'; +import StatusReactionWrapper from 'soapbox/components/status-reaction-wrapper.tsx'; +import { HStack } from 'soapbox/components/ui/index.ts'; +import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks/index.ts'; +import { GroupRoles } from 'soapbox/schemas/group-member.ts'; +import toast from 'soapbox/toast.tsx'; +import copy from 'soapbox/utils/copy.ts'; +import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji-reacts.ts'; -import GroupPopover from './groups/popover/group-popover'; +import GroupPopover from './groups/popover/group-popover.tsx'; -import type { Menu } from 'soapbox/components/dropdown-menu'; -import type { Group, Status } from 'soapbox/types/entities'; +import type { Menu } from 'soapbox/components/dropdown-menu/index.ts'; +import type { Group, Status } from 'soapbox/types/entities.ts'; const messages = defineMessages({ adminAccount: { id: 'status.admin_account', defaultMessage: 'Moderate @{name}' }, diff --git a/src/components/status-action-button.tsx b/src/components/status-action-button.tsx index e175b233f..7a15462ad 100644 --- a/src/components/status-action-button.tsx +++ b/src/components/status-action-button.tsx @@ -1,10 +1,10 @@ import clsx from 'clsx'; import { forwardRef } from 'react'; -import { Text, Icon, Emoji } from 'soapbox/components/ui'; -import { shortNumberFormat } from 'soapbox/utils/numbers'; +import { Text, Icon, Emoji } from 'soapbox/components/ui/index.ts'; +import { shortNumberFormat } from 'soapbox/utils/numbers.tsx'; -import type { EmojiReaction } from 'soapbox/schemas'; +import type { EmojiReaction } from 'soapbox/schemas/index.ts'; const COLORS = { accent: 'accent', diff --git a/src/components/status-content.tsx b/src/components/status-content.tsx index 24b1ee4d7..26f1ce128 100644 --- a/src/components/status-content.tsx +++ b/src/components/status-content.tsx @@ -4,18 +4,18 @@ import parse, { Element, type HTMLReactParserOptions, domToReact, type DOMNode } import { useState, useRef, useLayoutEffect, useMemo, memo } from 'react'; import { FormattedMessage } from 'react-intl'; -import Icon from 'soapbox/components/icon'; -import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content'; +import Icon from 'soapbox/components/icon.tsx'; +import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content.ts'; -import { getTextDirection } from '../utils/rtl'; +import { getTextDirection } from '../utils/rtl.ts'; -import HashtagLink from './hashtag-link'; -import Markup from './markup'; -import Mention from './mention'; -import Poll from './polls/poll'; +import HashtagLink from './hashtag-link.tsx'; +import Markup from './markup.tsx'; +import Mention from './mention.tsx'; +import Poll from './polls/poll.tsx'; -import type { Sizes } from 'soapbox/components/ui/text/text'; -import type { Status } from 'soapbox/types/entities'; +import type { Sizes } from 'soapbox/components/ui/text/text.tsx'; +import type { Status } from 'soapbox/types/entities.ts'; const MAX_HEIGHT = 642; // 20px * 32 (+ 2px padding at the top) const BIG_EMOJI_LIMIT = 10; diff --git a/src/components/status-hover-card.tsx b/src/components/status-hover-card.tsx index 7daa342f5..0093cdfdb 100644 --- a/src/components/status-hover-card.tsx +++ b/src/components/status-hover-card.tsx @@ -6,13 +6,13 @@ import { useHistory } from 'react-router-dom'; import { closeStatusHoverCard, updateStatusHoverCard, -} from 'soapbox/actions/status-hover-card'; -import { fetchStatus } from 'soapbox/actions/statuses'; -import StatusContainer from 'soapbox/containers/status-container'; -import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; +} from 'soapbox/actions/status-hover-card.ts'; +import { fetchStatus } from 'soapbox/actions/statuses.ts'; +import StatusContainer from 'soapbox/containers/status-container.tsx'; +import { useAppSelector, useAppDispatch } from 'soapbox/hooks/index.ts'; -import { showStatusHoverCard } from './hover-status-wrapper'; -import { Card, CardBody } from './ui'; +import { showStatusHoverCard } from './hover-status-wrapper.tsx'; +import { Card, CardBody } from './ui/index.ts'; interface IStatusHoverCard { visible?: boolean; diff --git a/src/components/status-list.tsx b/src/components/status-list.tsx index 769c1cdf5..b634b703f 100644 --- a/src/components/status-list.tsx +++ b/src/components/status-list.tsx @@ -3,17 +3,17 @@ import debounce from 'lodash/debounce'; import { useRef, useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; -import LoadGap from 'soapbox/components/load-gap'; -import ScrollableList from 'soapbox/components/scrollable-list'; -import StatusContainer from 'soapbox/containers/status-container'; -import FeedSuggestions from 'soapbox/features/feed-suggestions/feed-suggestions'; -import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status'; -import PendingStatus from 'soapbox/features/ui/components/pending-status'; -import { useSoapboxConfig } from 'soapbox/hooks'; +import LoadGap from 'soapbox/components/load-gap.tsx'; +import ScrollableList from 'soapbox/components/scrollable-list.tsx'; +import StatusContainer from 'soapbox/containers/status-container.tsx'; +import FeedSuggestions from 'soapbox/features/feed-suggestions/feed-suggestions.tsx'; +import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status.tsx'; +import PendingStatus from 'soapbox/features/ui/components/pending-status.tsx'; +import { useSoapboxConfig } from 'soapbox/hooks/index.ts'; import type { OrderedSet as ImmutableOrderedSet } from 'immutable'; import type { VirtuosoHandle } from 'react-virtuoso'; -import type { IScrollableList } from 'soapbox/components/scrollable-list'; +import type { IScrollableList } from 'soapbox/components/scrollable-list.tsx'; interface IStatusList extends Omit { /** Unique key to preserve the scroll position when navigating back. */ diff --git a/src/components/status-media.tsx b/src/components/status-media.tsx index cc82eed80..ad725ed1c 100644 --- a/src/components/status-media.tsx +++ b/src/components/status-media.tsx @@ -1,15 +1,16 @@ import { Suspense } from 'react'; -import { openModal } from 'soapbox/actions/modals'; -import AttachmentThumbs from 'soapbox/components/attachment-thumbs'; -import PreviewCard from 'soapbox/components/preview-card'; -import { GroupLinkPreview } from 'soapbox/features/groups/components/group-link-preview'; -import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card'; -import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components'; -import { useAppDispatch } from 'soapbox/hooks'; + +import { openModal } from 'soapbox/actions/modals.ts'; +import AttachmentThumbs from 'soapbox/components/attachment-thumbs.tsx'; +import PreviewCard from 'soapbox/components/preview-card.tsx'; +import { GroupLinkPreview } from 'soapbox/features/groups/components/group-link-preview.tsx'; +import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card.tsx'; +import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components.ts'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; import type { List as ImmutableList } from 'immutable'; -import type { Status, Attachment } from 'soapbox/types/entities'; +import type { Status, Attachment } from 'soapbox/types/entities.ts'; interface IStatusMedia { /** Status entity to render media for. */ diff --git a/src/components/status-reaction-wrapper.tsx b/src/components/status-reaction-wrapper.tsx index db3109ea4..ab76dd866 100644 --- a/src/components/status-reaction-wrapper.tsx +++ b/src/components/status-reaction-wrapper.tsx @@ -1,11 +1,11 @@ import { useState, useEffect, useRef, cloneElement } from 'react'; -import { simpleEmojiReact } from 'soapbox/actions/emoji-reacts'; -import { openModal } from 'soapbox/actions/modals'; -import { EmojiSelector, Portal } from 'soapbox/components/ui'; -import { useAppDispatch, useAppSelector, useOwnAccount, useSoapboxConfig } from 'soapbox/hooks'; -import { userTouching } from 'soapbox/is-mobile'; -import { getReactForStatus } from 'soapbox/utils/emoji-reacts'; +import { simpleEmojiReact } from 'soapbox/actions/emoji-reacts.ts'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { EmojiSelector, Portal } from 'soapbox/components/ui/index.ts'; +import { useAppDispatch, useAppSelector, useOwnAccount, useSoapboxConfig } from 'soapbox/hooks/index.ts'; +import { userTouching } from 'soapbox/is-mobile.ts'; +import { getReactForStatus } from 'soapbox/utils/emoji-reacts.ts'; interface IStatusReactionWrapper { statusId: string; diff --git a/src/components/status-reply-mentions.tsx b/src/components/status-reply-mentions.tsx index 06df6338c..5179d8e7e 100644 --- a/src/components/status-reply-mentions.tsx +++ b/src/components/status-reply-mentions.tsx @@ -1,13 +1,13 @@ import { FormattedList, FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; -import { openModal } from 'soapbox/actions/modals'; -import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; -import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper'; -import { useAppDispatch } from 'soapbox/hooks'; -import { shortenNostr } from 'soapbox/utils/nostr'; +import { openModal } from 'soapbox/actions/modals.ts'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper.tsx'; +import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper.tsx'; +import { useAppDispatch } from 'soapbox/hooks/index.ts'; +import { shortenNostr } from 'soapbox/utils/nostr.ts'; -import type { Status } from 'soapbox/types/entities'; +import type { Status } from 'soapbox/types/entities.ts'; interface IStatusReplyMentions { status: Status; diff --git a/src/components/status.test.tsx b/src/components/status.test.tsx index e78d805f4..b5dec5eb7 100644 --- a/src/components/status.test.tsx +++ b/src/components/status.test.tsx @@ -1,12 +1,12 @@ import { describe, expect, it } from 'vitest'; -import { buildAccount } from 'soapbox/jest/factory'; -import { render, screen, rootState } from 'soapbox/jest/test-helpers'; -import { normalizeStatus } from 'soapbox/normalizers'; +import { buildAccount } from 'soapbox/jest/factory.ts'; +import { render, screen, rootState } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeStatus } from 'soapbox/normalizers/index.ts'; -import Status from './status'; +import Status from './status.tsx'; -import type { ReducerStatus } from 'soapbox/reducers/statuses'; +import type { ReducerStatus } from 'soapbox/reducers/statuses.ts'; const account = buildAccount({ id: '1', diff --git a/src/components/status.tsx b/src/components/status.tsx index 577bdd2f9..45d146504 100644 --- a/src/components/status.tsx +++ b/src/components/status.tsx @@ -6,28 +6,28 @@ import { useEffect, useRef, useState } from 'react'; import { useIntl, FormattedMessage, defineMessages } from 'react-intl'; import { Link, useHistory } from 'react-router-dom'; -import { mentionCompose, replyCompose } from 'soapbox/actions/compose'; -import { toggleFavourite, toggleReblog } from 'soapbox/actions/interactions'; -import { openModal } from 'soapbox/actions/modals'; -import { toggleStatusHidden, unfilterStatus } from 'soapbox/actions/statuses'; -import TranslateButton from 'soapbox/components/translate-button'; -import AccountContainer from 'soapbox/containers/account-container'; -import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container'; -import { HotKeys } from 'soapbox/features/ui/components/hotkeys'; -import { useAppDispatch, useSettings } from 'soapbox/hooks'; -import { defaultMediaVisibility, textForScreenReader, getActualStatus } from 'soapbox/utils/status'; +import { mentionCompose, replyCompose } from 'soapbox/actions/compose.ts'; +import { toggleFavourite, toggleReblog } from 'soapbox/actions/interactions.ts'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { toggleStatusHidden, unfilterStatus } from 'soapbox/actions/statuses.ts'; +import TranslateButton from 'soapbox/components/translate-button.tsx'; +import AccountContainer from 'soapbox/containers/account-container.tsx'; +import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container.tsx'; +import { HotKeys } from 'soapbox/features/ui/components/hotkeys.tsx'; +import { useAppDispatch, useSettings } from 'soapbox/hooks/index.ts'; +import { defaultMediaVisibility, textForScreenReader, getActualStatus } from 'soapbox/utils/status.ts'; -import EventPreview from './event-preview'; -import StatusActionBar from './status-action-bar'; -import StatusContent from './status-content'; -import StatusMedia from './status-media'; -import StatusReplyMentions from './status-reply-mentions'; -import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; -import StatusInfo from './statuses/status-info'; -import Tombstone from './tombstone'; -import { Card, Icon, Stack, Text } from './ui'; +import EventPreview from './event-preview.tsx'; +import StatusActionBar from './status-action-bar.tsx'; +import StatusContent from './status-content.tsx'; +import StatusMedia from './status-media.tsx'; +import StatusReplyMentions from './status-reply-mentions.tsx'; +import SensitiveContentOverlay from './statuses/sensitive-content-overlay.tsx'; +import StatusInfo from './statuses/status-info.tsx'; +import Tombstone from './tombstone.tsx'; +import { Card, Icon, Stack, Text } from './ui/index.ts'; -import type { Status as StatusEntity } from 'soapbox/types/entities'; +import type { Status as StatusEntity } from 'soapbox/types/entities.ts'; // Defined in components/scrollable-list export type ScrollPosition = { height: number; top: number }; diff --git a/src/components/statuses/sensitive-content-overlay.test.tsx b/src/components/statuses/sensitive-content-overlay.test.tsx index b998321cc..7b49c5618 100644 --- a/src/components/statuses/sensitive-content-overlay.test.tsx +++ b/src/components/statuses/sensitive-content-overlay.test.tsx @@ -1,11 +1,11 @@ import { Map as ImmutableMap } from 'immutable'; import { beforeEach, describe, expect, it } from 'vitest'; -import { fireEvent, render, rootState, screen } from 'soapbox/jest/test-helpers'; -import { normalizeStatus } from 'soapbox/normalizers'; -import { ReducerStatus } from 'soapbox/reducers/statuses'; +import { fireEvent, render, rootState, screen } from 'soapbox/jest/test-helpers.tsx'; +import { normalizeStatus } from 'soapbox/normalizers/index.ts'; +import { ReducerStatus } from 'soapbox/reducers/statuses.ts'; -import SensitiveContentOverlay from './sensitive-content-overlay'; +import SensitiveContentOverlay from './sensitive-content-overlay.tsx'; describe('', () => { let status: ReducerStatus; diff --git a/src/components/statuses/sensitive-content-overlay.tsx b/src/components/statuses/sensitive-content-overlay.tsx index d1aedcf67..4268f513b 100644 --- a/src/components/statuses/sensitive-content-overlay.tsx +++ b/src/components/statuses/sensitive-content-overlay.tsx @@ -7,15 +7,15 @@ import clsx from 'clsx'; import { forwardRef, useEffect, useMemo, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { openModal } from 'soapbox/actions/modals'; -import { deleteStatus } from 'soapbox/actions/statuses'; -import { useAppDispatch, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks'; -import { defaultMediaVisibility } from 'soapbox/utils/status'; +import { openModal } from 'soapbox/actions/modals.ts'; +import { deleteStatus } from 'soapbox/actions/statuses.ts'; +import { useAppDispatch, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks/index.ts'; +import { defaultMediaVisibility } from 'soapbox/utils/status.ts'; -import DropdownMenu from '../dropdown-menu'; -import { Button, HStack, Text } from '../ui'; +import DropdownMenu from '../dropdown-menu/index.ts'; +import { Button, HStack, Text } from '../ui/index.ts'; -import type { Status as StatusEntity } from 'soapbox/types/entities'; +import type { Status as StatusEntity } from 'soapbox/types/entities.ts'; const messages = defineMessages({ delete: { id: 'status.delete', defaultMessage: 'Delete' }, diff --git a/src/components/statuses/status-info.tsx b/src/components/statuses/status-info.tsx index 288c5e018..289112a8d 100644 --- a/src/components/statuses/status-info.tsx +++ b/src/components/statuses/status-info.tsx @@ -1,4 +1,4 @@ -import { HStack, Text } from '../ui'; +import { HStack, Text } from 'soapbox/components/ui/index.ts'; interface IStatusInfo { avatarSize: number; diff --git a/src/components/still-image.tsx b/src/components/still-image.tsx index 3f788de12..f142e7c35 100644 --- a/src/components/still-image.tsx +++ b/src/components/still-image.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { useRef } from 'react'; -import { useSettings } from 'soapbox/hooks'; +import { useSettings } from 'soapbox/hooks/index.ts'; export interface IStillImage { /** Image alt text. */ diff --git a/src/components/thumb-navigation-link.tsx b/src/components/thumb-navigation-link.tsx index e395d5884..83792f0fd 100644 --- a/src/components/thumb-navigation-link.tsx +++ b/src/components/thumb-navigation-link.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; import { NavLink, useLocation } from 'react-router-dom'; -import IconWithCounter from 'soapbox/components/icon-with-counter'; -import { Icon, Text } from 'soapbox/components/ui'; +import IconWithCounter from 'soapbox/components/icon-with-counter.tsx'; +import { Icon, Text } from 'soapbox/components/ui/index.ts'; interface IThumbNavigationLink { count?: number; diff --git a/src/components/thumb-navigation.tsx b/src/components/thumb-navigation.tsx index 21f4805f2..cfa577c42 100644 --- a/src/components/thumb-navigation.tsx +++ b/src/components/thumb-navigation.tsx @@ -11,9 +11,9 @@ import messagesIcon from '@tabler/icons/outline/messages.svg'; import searchIcon from '@tabler/icons/outline/search.svg'; import { FormattedMessage } from 'react-intl'; -import ThumbNavigationLink from 'soapbox/components/thumb-navigation-link'; -import { useStatContext } from 'soapbox/contexts/stat-context'; -import { useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks'; +import ThumbNavigationLink from 'soapbox/components/thumb-navigation-link.tsx'; +import { useStatContext } from 'soapbox/contexts/stat-context.tsx'; +import { useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks/index.ts'; const ThumbNavigation: React.FC = (): JSX.Element => { const { account } = useOwnAccount(); diff --git a/src/components/tombstone.tsx b/src/components/tombstone.tsx index b11142b94..a0094adc0 100644 --- a/src/components/tombstone.tsx +++ b/src/components/tombstone.tsx @@ -1,7 +1,7 @@ import { FormattedMessage } from 'react-intl'; -import { Text } from 'soapbox/components/ui'; -import { HotKeys } from 'soapbox/features/ui/components/hotkeys'; +import { Text } from 'soapbox/components/ui/index.ts'; +import { HotKeys } from 'soapbox/features/ui/components/hotkeys.tsx'; interface ITombstone { id: string; diff --git a/src/components/translate-button.tsx b/src/components/translate-button.tsx index 71b425d32..ddb250c5e 100644 --- a/src/components/translate-button.tsx +++ b/src/components/translate-button.tsx @@ -1,12 +1,12 @@ import languageIcon from '@tabler/icons/outline/language.svg'; import { FormattedMessage, useIntl } from 'react-intl'; -import { translateStatus, undoStatusTranslation } from 'soapbox/actions/statuses'; -import { useAppDispatch, useAppSelector, useFeatures, useInstance } from 'soapbox/hooks'; +import { translateStatus, undoStatusTranslation } from 'soapbox/actions/statuses.ts'; +import { useAppDispatch, useAppSelector, useFeatures, useInstance } from 'soapbox/hooks/index.ts'; -import { Stack, Button, Text } from './ui'; +import { Stack, Button, Text } from './ui/index.ts'; -import type { Status } from 'soapbox/types/entities'; +import type { Status } from 'soapbox/types/entities.ts'; interface ITranslateButton { status: Status; diff --git a/src/components/ui/accordion/accordion.tsx b/src/components/ui/accordion/accordion.tsx index ca301a813..4c0a89d41 100644 --- a/src/components/ui/accordion/accordion.tsx +++ b/src/components/ui/accordion/accordion.tsx @@ -4,13 +4,13 @@ import dotsVerticalIcon from '@tabler/icons/outline/dots-vertical.svg'; import clsx from 'clsx'; import { defineMessages, useIntl } from 'react-intl'; -import DropdownMenu from 'soapbox/components/dropdown-menu'; +import DropdownMenu from 'soapbox/components/dropdown-menu/index.ts'; -import HStack from '../hstack/hstack'; -import Icon from '../icon/icon'; -import Text from '../text/text'; +import HStack from '../hstack/hstack.tsx'; +import Icon from '../icon/icon.tsx'; +import Text from '../text/text.tsx'; -import type { Menu } from 'soapbox/components/dropdown-menu'; +import type { Menu } from 'soapbox/components/dropdown-menu/index.ts'; const messages = defineMessages({ collapse: { id: 'accordion.collapse', defaultMessage: 'Collapse' }, diff --git a/src/components/ui/avatar/avatar.test.tsx b/src/components/ui/avatar/avatar.test.tsx index 1bd9fb519..3c54f77a7 100644 --- a/src/components/ui/avatar/avatar.test.tsx +++ b/src/components/ui/avatar/avatar.test.tsx @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import { render, screen } from 'soapbox/jest/test-helpers'; +import { render, screen } from 'soapbox/jest/test-helpers.tsx'; -import Avatar from './avatar'; +import Avatar from './avatar.tsx'; const src = '/static/alice.jpg'; diff --git a/src/components/ui/avatar/avatar.tsx b/src/components/ui/avatar/avatar.tsx index 7bdd0a52e..ed6522119 100644 --- a/src/components/ui/avatar/avatar.tsx +++ b/src/components/ui/avatar/avatar.tsx @@ -2,9 +2,9 @@ import photoOffIcon from '@tabler/icons/outline/photo-off.svg'; import clsx from 'clsx'; import { useMemo, useState } from 'react'; -import StillImage, { IStillImage } from 'soapbox/components/still-image'; +import StillImage, { IStillImage } from 'soapbox/components/still-image.tsx'; -import Icon from '../icon/icon'; +import Icon from '../icon/icon.tsx'; const AVATAR_SIZE = 42; diff --git a/src/components/ui/button/button.test.tsx b/src/components/ui/button/button.test.tsx index a28e1da05..80a0ebfa0 100644 --- a/src/components/ui/button/button.test.tsx +++ b/src/components/ui/button/button.test.tsx @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from 'vitest'; -import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; +import { fireEvent, render, screen } from 'soapbox/jest/test-helpers.tsx'; -import Button from './button'; +import Button from './button.tsx'; describe('