diff --git a/packages/pl-fe/src/actions/compose.ts b/packages/pl-fe/src/actions/compose.ts index 7384edca15..2e0d852471 100644 --- a/packages/pl-fe/src/actions/compose.ts +++ b/packages/pl-fe/src/actions/compose.ts @@ -22,7 +22,8 @@ import type { EditorState } from 'lexical'; import type { Account as BaseAccount, BackendVersion, CreateStatusParams, Group, MediaAttachment, Status as BaseStatus, Tag, Poll, ScheduledStatus } from 'pl-api'; import type { AutoSuggestion } from 'pl-fe/components/autosuggest-input'; import type { Emoji } from 'pl-fe/features/emoji'; -import type { Account, Status } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Status } from 'pl-fe/normalizers/status'; import type { AppDispatch, RootState } from 'pl-fe/store'; import type { History } from 'pl-fe/types/history'; diff --git a/packages/pl-fe/src/actions/notifications.test.ts b/packages/pl-fe/src/actions/notifications.test.ts index cef506110a..2949fe46ab 100644 --- a/packages/pl-fe/src/actions/notifications.test.ts +++ b/packages/pl-fe/src/actions/notifications.test.ts @@ -2,7 +2,7 @@ import { OrderedMap as ImmutableOrderedMap } from 'immutable'; import { __stub } from 'pl-fe/api'; import { mockStore, rootState } from 'pl-fe/jest/test-helpers'; -import { normalizeNotification } from 'pl-fe/normalizers'; +import { normalizeNotification } from 'pl-fe/normalizers/notification'; import { markReadNotifications } from './notifications'; diff --git a/packages/pl-fe/src/actions/notifications.ts b/packages/pl-fe/src/actions/notifications.ts index 1d1dce8dfd..6e2e1fe68c 100644 --- a/packages/pl-fe/src/actions/notifications.ts +++ b/packages/pl-fe/src/actions/notifications.ts @@ -4,7 +4,7 @@ import { defineMessages } from 'react-intl'; import { getClient } from 'pl-fe/api'; import { getNotificationStatus } from 'pl-fe/features/notifications/components/notification'; -import { normalizeNotification, normalizeNotifications, type Notification } from 'pl-fe/normalizers'; +import { normalizeNotification, normalizeNotifications, type Notification } from 'pl-fe/normalizers/notification'; import { getFilters, regexFromFilters } from 'pl-fe/selectors'; import { useSettingsStore } from 'pl-fe/stores/settings'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/actions/pl-fe.ts b/packages/pl-fe/src/actions/pl-fe.ts index f4c981ec7a..2b2f4282d8 100644 --- a/packages/pl-fe/src/actions/pl-fe.ts +++ b/packages/pl-fe/src/actions/pl-fe.ts @@ -1,7 +1,7 @@ import { createSelector } from 'reselect'; import { getHost } from 'pl-fe/actions/instance'; -import { normalizePlFeConfig } from 'pl-fe/normalizers'; +import { normalizePlFeConfig } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import KVStore from 'pl-fe/storage/kv-store'; import { useSettingsStore } from 'pl-fe/stores/settings'; diff --git a/packages/pl-fe/src/actions/reports.ts b/packages/pl-fe/src/actions/reports.ts index adc8543392..fa59e08338 100644 --- a/packages/pl-fe/src/actions/reports.ts +++ b/packages/pl-fe/src/actions/reports.ts @@ -2,7 +2,8 @@ import { useModalsStore } from 'pl-fe/stores/modals'; import { getClient } from '../api'; -import type { Account, Status } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Status } from 'pl-fe/normalizers/status'; import type { AppDispatch, RootState } from 'pl-fe/store'; const REPORT_SUBMIT_REQUEST = 'REPORT_SUBMIT_REQUEST' as const; diff --git a/packages/pl-fe/src/api/hooks/admin/useSuggest.ts b/packages/pl-fe/src/api/hooks/admin/useSuggest.ts index db2d946c3b..f392e91514 100644 --- a/packages/pl-fe/src/api/hooks/admin/useSuggest.ts +++ b/packages/pl-fe/src/api/hooks/admin/useSuggest.ts @@ -1,5 +1,5 @@ -import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction'; import { EntityCallbacks } from 'pl-fe/entity-store/hooks/types'; +import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction'; import { useClient } from 'pl-fe/hooks/useClient'; import type { Account } from 'pl-fe/normalizers/account'; diff --git a/packages/pl-fe/src/api/hooks/groups/useCreateGroup.ts b/packages/pl-fe/src/api/hooks/groups/useCreateGroup.ts index 5c8eb8da92..34422ebb57 100644 --- a/packages/pl-fe/src/api/hooks/groups/useCreateGroup.ts +++ b/packages/pl-fe/src/api/hooks/groups/useCreateGroup.ts @@ -1,7 +1,7 @@ import { Entities } from 'pl-fe/entity-store/entities'; import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroup, type Group } from 'pl-fe/normalizers'; +import { normalizeGroup, type Group } from 'pl-fe/normalizers/group'; import type { Group as BaseGroup, CreateGroupParams } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/groups/useDemoteGroupMember.ts b/packages/pl-fe/src/api/hooks/groups/useDemoteGroupMember.ts index b7069791dc..5f8ee3e082 100644 --- a/packages/pl-fe/src/api/hooks/groups/useDemoteGroupMember.ts +++ b/packages/pl-fe/src/api/hooks/groups/useDemoteGroupMember.ts @@ -3,7 +3,7 @@ import * as v from 'valibot'; import { Entities } from 'pl-fe/entity-store/entities'; import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroupMember } from 'pl-fe/normalizers'; +import { normalizeGroupMember } from 'pl-fe/normalizers/group-member'; import type { Group, GroupMember as GroupMember, GroupRole } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/groups/useGroup.ts b/packages/pl-fe/src/api/hooks/groups/useGroup.ts index a97e140e90..2389d2e7b8 100644 --- a/packages/pl-fe/src/api/hooks/groups/useGroup.ts +++ b/packages/pl-fe/src/api/hooks/groups/useGroup.ts @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom'; import { Entities } from 'pl-fe/entity-store/entities'; import { useEntity } from 'pl-fe/entity-store/hooks/useEntity'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroup, type Group } from 'pl-fe/normalizers'; +import { normalizeGroup, type Group } from 'pl-fe/normalizers/group'; import { useGroupRelationship } from './useGroupRelationship'; diff --git a/packages/pl-fe/src/api/hooks/groups/useGroupMedia.ts b/packages/pl-fe/src/api/hooks/groups/useGroupMedia.ts index d97b72d0e6..9f2b099c40 100644 --- a/packages/pl-fe/src/api/hooks/groups/useGroupMedia.ts +++ b/packages/pl-fe/src/api/hooks/groups/useGroupMedia.ts @@ -1,7 +1,7 @@ import { Entities } from 'pl-fe/entity-store/entities'; import { useEntities } from 'pl-fe/entity-store/hooks/useEntities'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeStatus } from 'pl-fe/normalizers'; +import { normalizeStatus } from 'pl-fe/normalizers/status'; const useGroupMedia = (groupId: string) => { const client = useClient(); diff --git a/packages/pl-fe/src/api/hooks/groups/useGroupMembers.ts b/packages/pl-fe/src/api/hooks/groups/useGroupMembers.ts index c097ff3857..9a2978831c 100644 --- a/packages/pl-fe/src/api/hooks/groups/useGroupMembers.ts +++ b/packages/pl-fe/src/api/hooks/groups/useGroupMembers.ts @@ -1,7 +1,7 @@ import { Entities } from 'pl-fe/entity-store/entities'; import { useEntities } from 'pl-fe/entity-store/hooks/useEntities'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroupMember, type GroupMember } from 'pl-fe/normalizers'; +import { normalizeGroupMember, type GroupMember } from 'pl-fe/normalizers/group-member'; import type { GroupMember as BaseGroupMember, GroupRoles } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/groups/useGroups.ts b/packages/pl-fe/src/api/hooks/groups/useGroups.ts index 17d6caafa8..be212bdfee 100644 --- a/packages/pl-fe/src/api/hooks/groups/useGroups.ts +++ b/packages/pl-fe/src/api/hooks/groups/useGroups.ts @@ -2,7 +2,7 @@ import { Entities } from 'pl-fe/entity-store/entities'; import { useEntities } from 'pl-fe/entity-store/hooks/useEntities'; import { useClient } from 'pl-fe/hooks/useClient'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; -import { normalizeGroup, type Group } from 'pl-fe/normalizers'; +import { normalizeGroup, type Group } from 'pl-fe/normalizers/group'; import { useGroupRelationships } from './useGroupRelationships'; diff --git a/packages/pl-fe/src/api/hooks/groups/usePromoteGroupMember.ts b/packages/pl-fe/src/api/hooks/groups/usePromoteGroupMember.ts index 524dfff8ef..d961d7caa2 100644 --- a/packages/pl-fe/src/api/hooks/groups/usePromoteGroupMember.ts +++ b/packages/pl-fe/src/api/hooks/groups/usePromoteGroupMember.ts @@ -3,7 +3,7 @@ import * as v from 'valibot'; import { Entities } from 'pl-fe/entity-store/entities'; import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroupMember } from 'pl-fe/normalizers'; +import { normalizeGroupMember } from 'pl-fe/normalizers/group-member'; import type { Group, GroupMember, GroupRole } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/groups/useUpdateGroup.ts b/packages/pl-fe/src/api/hooks/groups/useUpdateGroup.ts index 971e63c1dc..efe91ed342 100644 --- a/packages/pl-fe/src/api/hooks/groups/useUpdateGroup.ts +++ b/packages/pl-fe/src/api/hooks/groups/useUpdateGroup.ts @@ -1,7 +1,7 @@ import { Entities } from 'pl-fe/entity-store/entities'; import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity'; import { useClient } from 'pl-fe/hooks/useClient'; -import { normalizeGroup } from 'pl-fe/normalizers'; +import { normalizeGroup } from 'pl-fe/normalizers/group'; interface UpdateGroupParams { display_name?: string; diff --git a/packages/pl-fe/src/components/account.tsx b/packages/pl-fe/src/components/account.tsx index 351b076107..fcb716158a 100644 --- a/packages/pl-fe/src/components/account.tsx +++ b/packages/pl-fe/src/components/account.tsx @@ -20,7 +20,7 @@ import Badge from './badge'; import { ParsedContent } from './parsed-content'; import RelativeTimestamp from './relative-timestamp'; -import type { Account as AccountSchema } from 'pl-fe/normalizers'; +import type { Account as AccountSchema } from 'pl-fe/normalizers/account'; import type { StatusApprovalStatus } from 'pl-fe/normalizers/status'; interface IInstanceFavicon { diff --git a/packages/pl-fe/src/components/announcements/announcement.tsx b/packages/pl-fe/src/components/announcements/announcement.tsx index 82a49d5521..d83d01feb0 100644 --- a/packages/pl-fe/src/components/announcements/announcement.tsx +++ b/packages/pl-fe/src/components/announcements/announcement.tsx @@ -11,7 +11,7 @@ import ReactionsBar from './reactions-bar'; import type { Map as ImmutableMap } from 'immutable'; import type { CustomEmoji } from 'pl-api'; -import type { Announcement as AnnouncementEntity } from 'pl-fe/normalizers'; +import type { Announcement as AnnouncementEntity } from 'pl-fe/normalizers/announcement'; interface IAnnouncement { announcement: AnnouncementEntity; diff --git a/packages/pl-fe/src/components/birthday-input.tsx b/packages/pl-fe/src/components/birthday-input.tsx index f321686b0f..0ddae1780d 100644 --- a/packages/pl-fe/src/components/birthday-input.tsx +++ b/packages/pl-fe/src/components/birthday-input.tsx @@ -3,8 +3,8 @@ import { defineMessages, useIntl } from 'react-intl'; import IconButton from 'pl-fe/components/icon-button'; import { DatePicker } from 'pl-fe/features/ui/util/async-components'; -import { useInstance } from 'pl-fe/hooks/useInstance'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; +import { useInstance } from 'pl-fe/hooks/useInstance'; const messages = defineMessages({ birthdayPlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birthday' }, diff --git a/packages/pl-fe/src/components/event-preview.tsx b/packages/pl-fe/src/components/event-preview.tsx index 48acbbe089..115d085128 100644 --- a/packages/pl-fe/src/components/event-preview.tsx +++ b/packages/pl-fe/src/components/event-preview.tsx @@ -12,7 +12,7 @@ import EventActionButton from 'pl-fe/features/event/components/event-action-butt import EventDate from 'pl-fe/features/event/components/event-date'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; const messages = defineMessages({ eventBanner: { id: 'event.banner', defaultMessage: 'Event banner' }, diff --git a/packages/pl-fe/src/components/group-card.tsx b/packages/pl-fe/src/components/group-card.tsx index a1aaff238e..66c604e56c 100644 --- a/packages/pl-fe/src/components/group-card.tsx +++ b/packages/pl-fe/src/components/group-card.tsx @@ -10,7 +10,7 @@ import GroupRelationship from 'pl-fe/features/group/components/group-relationshi import GroupAvatar from './groups/group-avatar'; -import type { Group as GroupEntity } from 'pl-fe/normalizers'; +import type { Group as GroupEntity } from 'pl-fe/normalizers/group'; interface IGroupCard { group: GroupEntity; diff --git a/packages/pl-fe/src/components/sidebar-menu.tsx b/packages/pl-fe/src/components/sidebar-menu.tsx index e4f8e46b2e..9420042d19 100644 --- a/packages/pl-fe/src/components/sidebar-menu.tsx +++ b/packages/pl-fe/src/components/sidebar-menu.tsx @@ -24,7 +24,7 @@ import { useUiStore } from 'pl-fe/stores/ui'; import sourceCode from 'pl-fe/utils/code'; import type { List as ImmutableList } from 'immutable'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; const messages = defineMessages({ profile: { id: 'account.profile', defaultMessage: 'Profile' }, diff --git a/packages/pl-fe/src/components/sidebar-navigation.tsx b/packages/pl-fe/src/components/sidebar-navigation.tsx index 5a1a62e4eb..a23e56246a 100644 --- a/packages/pl-fe/src/components/sidebar-navigation.tsx +++ b/packages/pl-fe/src/components/sidebar-navigation.tsx @@ -9,11 +9,11 @@ import ComposeButton from 'pl-fe/features/ui/components/compose-button'; import ProfileDropdown from 'pl-fe/features/ui/components/profile-dropdown'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; -import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; -import { useSettings } from 'pl-fe/hooks/useSettings'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { useRegistrationStatus } from 'pl-fe/hooks/useRegistrationStatus'; import { useLogo } from 'pl-fe/hooks/useLogo'; +import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; +import { useRegistrationStatus } from 'pl-fe/hooks/useRegistrationStatus'; +import { useSettings } from 'pl-fe/hooks/useSettings'; import Account from './account'; import DropdownMenu, { Menu } from './dropdown-menu'; diff --git a/packages/pl-fe/src/components/status-action-bar.tsx b/packages/pl-fe/src/components/status-action-bar.tsx index eb0b27efcd..ca96e3a676 100644 --- a/packages/pl-fe/src/components/status-action-bar.tsx +++ b/packages/pl-fe/src/components/status-action-bar.tsx @@ -40,7 +40,8 @@ import GroupPopover from './groups/popover/group-popover'; import type { Menu } from 'pl-fe/components/dropdown-menu'; import type { Emoji as EmojiType } from 'pl-fe/features/emoji'; import type { UnauthorizedModalAction } from 'pl-fe/features/ui/components/modals/unauthorized-modal'; -import type { Account, Group } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Group } from 'pl-fe/normalizers/group'; import type { SelectedStatus } from 'pl-fe/selectors'; const messages = defineMessages({ diff --git a/packages/pl-fe/src/components/status.test.tsx b/packages/pl-fe/src/components/status.test.tsx index b440b36152..4872720f17 100644 --- a/packages/pl-fe/src/components/status.test.tsx +++ b/packages/pl-fe/src/components/status.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { buildAccount } from 'pl-fe/jest/factory'; import { render, screen, rootState } from 'pl-fe/jest/test-helpers'; -import { normalizeStatus } from 'pl-fe/normalizers'; +import { normalizeStatus } from 'pl-fe/normalizers/status'; import Status from './status'; diff --git a/packages/pl-fe/src/components/statuses/sensitive-content-overlay.test.tsx b/packages/pl-fe/src/components/statuses/sensitive-content-overlay.test.tsx index 1f24bb8ec7..9d15424598 100644 --- a/packages/pl-fe/src/components/statuses/sensitive-content-overlay.test.tsx +++ b/packages/pl-fe/src/components/statuses/sensitive-content-overlay.test.tsx @@ -2,7 +2,7 @@ import { Map as ImmutableMap } from 'immutable'; import React from 'react'; import { fireEvent, render, rootState, screen } from 'pl-fe/jest/test-helpers'; -import { normalizeStatus } from 'pl-fe/normalizers'; +import { normalizeStatus } from 'pl-fe/normalizers/status'; import { ReducerStatus } from 'pl-fe/reducers/statuses'; import SensitiveContentOverlay from './sensitive-content-overlay'; diff --git a/packages/pl-fe/src/entity-store/entities.ts b/packages/pl-fe/src/entity-store/entities.ts index 3c25874e3a..2c122cf372 100644 --- a/packages/pl-fe/src/entity-store/entities.ts +++ b/packages/pl-fe/src/entity-store/entities.ts @@ -1,5 +1,7 @@ import type { AdminDomain, AdminRelay, AdminRule, BookmarkFolder, GroupMember, GroupRelationship, Relationship, Scrobble, TrendsLink } from 'pl-api'; -import type { Account, Group, Status } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Group } from 'pl-fe/normalizers/group'; +import type { Status } from 'pl-fe/normalizers/status'; enum Entities { ACCOUNTS = 'Accounts', diff --git a/packages/pl-fe/src/features/about/index.tsx b/packages/pl-fe/src/features/about/index.tsx index 6b030beb7c..23f2052840 100644 --- a/packages/pl-fe/src/features/about/index.tsx +++ b/packages/pl-fe/src/features/about/index.tsx @@ -5,9 +5,9 @@ import { useParams } from 'react-router-dom'; import { fetchAboutPage } from 'pl-fe/actions/about'; import { Navlinks } from 'pl-fe/components/navlinks'; import Card from 'pl-fe/components/ui/card'; +import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; import { useSettings } from 'pl-fe/hooks/useSettings'; -import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { languages } from '../preferences'; diff --git a/packages/pl-fe/src/features/account-timeline/components/moved-note.tsx b/packages/pl-fe/src/features/account-timeline/components/moved-note.tsx index adabb9847d..c98f39a91d 100644 --- a/packages/pl-fe/src/features/account-timeline/components/moved-note.tsx +++ b/packages/pl-fe/src/features/account-timeline/components/moved-note.tsx @@ -6,7 +6,7 @@ import Icon from 'pl-fe/components/icon'; import HStack from 'pl-fe/components/ui/hstack'; import Text from 'pl-fe/components/ui/text'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; interface IMovedNote { from: AccountEntity; diff --git a/packages/pl-fe/src/features/admin/announcements.tsx b/packages/pl-fe/src/features/admin/announcements.tsx index 39f31fc05a..ea1ccc7798 100644 --- a/packages/pl-fe/src/features/admin/announcements.tsx +++ b/packages/pl-fe/src/features/admin/announcements.tsx @@ -8,7 +8,7 @@ import Column from 'pl-fe/components/ui/column'; import HStack from 'pl-fe/components/ui/hstack'; import Stack from 'pl-fe/components/ui/stack'; import Text from 'pl-fe/components/ui/text'; -import { AdminAnnouncement } from 'pl-fe/normalizers'; +import { AdminAnnouncement } from 'pl-fe/normalizers/announcement'; import { useModalsStore } from 'pl-fe/stores/modals'; import toast from 'pl-fe/toast'; diff --git a/packages/pl-fe/src/features/admin/tabs/dashboard.tsx b/packages/pl-fe/src/features/admin/tabs/dashboard.tsx index d3ca91d6d9..b8e3c8a53b 100644 --- a/packages/pl-fe/src/features/admin/tabs/dashboard.tsx +++ b/packages/pl-fe/src/features/admin/tabs/dashboard.tsx @@ -5,9 +5,9 @@ import List, { ListItem } from 'pl-fe/components/list'; import { CardTitle } from 'pl-fe/components/ui/card'; import Icon from 'pl-fe/components/ui/icon'; import Stack from 'pl-fe/components/ui/stack'; -import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; +import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; import sourceCode from 'pl-fe/utils/code'; import { DashCounter, DashCounters } from '../components/dashcounter'; diff --git a/packages/pl-fe/src/features/auth-login/components/registration-form.tsx b/packages/pl-fe/src/features/auth-login/components/registration-form.tsx index 3c6d837cd5..1af855c00d 100644 --- a/packages/pl-fe/src/features/auth-login/components/registration-form.tsx +++ b/packages/pl-fe/src/features/auth-login/components/registration-form.tsx @@ -17,9 +17,9 @@ import Select from 'pl-fe/components/ui/select'; import Textarea from 'pl-fe/components/ui/textarea'; import CaptchaField from 'pl-fe/features/auth-login/components/captcha'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; -import { useSettings } from 'pl-fe/hooks/useSettings'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; +import { useSettings } from 'pl-fe/hooks/useSettings'; import { useModalsStore } from 'pl-fe/stores/modals'; import type { CreateAccountParams } from 'pl-api'; diff --git a/packages/pl-fe/src/features/bookmarks/index.tsx b/packages/pl-fe/src/features/bookmarks/index.tsx index adfbdc46dc..5bff4b4871 100644 --- a/packages/pl-fe/src/features/bookmarks/index.tsx +++ b/packages/pl-fe/src/features/bookmarks/index.tsx @@ -11,10 +11,10 @@ import DropdownMenu from 'pl-fe/components/dropdown-menu'; import PullToRefresh from 'pl-fe/components/pull-to-refresh'; import StatusList from 'pl-fe/components/status-list'; import Column from 'pl-fe/components/ui/column'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; -import { useTheme } from 'pl-fe/hooks/useTheme'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; import { useModalsStore } from 'pl-fe/stores/modals'; import toast from 'pl-fe/toast'; diff --git a/packages/pl-fe/src/features/bubble-timeline/index.tsx b/packages/pl-fe/src/features/bubble-timeline/index.tsx index 17a16a2126..f9dbd0e864 100644 --- a/packages/pl-fe/src/features/bubble-timeline/index.tsx +++ b/packages/pl-fe/src/features/bubble-timeline/index.tsx @@ -5,9 +5,9 @@ import { fetchBubbleTimeline } from 'pl-fe/actions/timelines'; import PullToRefresh from 'pl-fe/components/pull-to-refresh'; import Column from 'pl-fe/components/ui/column'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/chats/components/chat-message-list.test.tsx b/packages/pl-fe/src/features/chats/components/chat-message-list.test.tsx index 960efc3aa0..9e944afd5d 100644 --- a/packages/pl-fe/src/features/chats/components/chat-message-list.test.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-message-list.test.tsx @@ -5,7 +5,7 @@ import { __stub } from 'pl-fe/api'; import { ChatContext } from 'pl-fe/contexts/chat-context'; import { buildAccount, buildInstance } from 'pl-fe/jest/factory'; import { queryClient, render, rootState, screen, waitFor } from 'pl-fe/jest/test-helpers'; -import { normalizeChatMessage } from 'pl-fe/normalizers'; +import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message'; import { IChat } from 'pl-fe/queries/chats'; import { ChatMessage } from 'pl-fe/types/entities'; diff --git a/packages/pl-fe/src/features/chats/components/chat-message-list.tsx b/packages/pl-fe/src/features/chats/components/chat-message-list.tsx index 40070c6850..9cfe00ba54 100644 --- a/packages/pl-fe/src/features/chats/components/chat-message-list.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-message-list.tsx @@ -15,7 +15,7 @@ import { useChatActions, useChatMessages } from 'pl-fe/queries/chats'; import ChatMessage from './chat-message'; import type { Chat, Relationship } from 'pl-api'; -import type { ChatMessage as ChatMessageEntity } from 'pl-fe/normalizers'; +import type { ChatMessage as ChatMessageEntity } from 'pl-fe/normalizers/chat-message'; const messages = defineMessages({ today: { id: 'chats.dividers.today', defaultMessage: 'Today' }, diff --git a/packages/pl-fe/src/features/chats/components/chat-message.tsx b/packages/pl-fe/src/features/chats/components/chat-message.tsx index 38dbb15549..72186b1921 100644 --- a/packages/pl-fe/src/features/chats/components/chat-message.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-message.tsx @@ -20,7 +20,7 @@ import { onlyEmoji } from 'pl-fe/utils/rich-content'; import type { Chat, CustomEmoji } from 'pl-api'; import type { Menu as IMenu } from 'pl-fe/components/dropdown-menu'; -import type { ChatMessage as ChatMessageEntity } from 'pl-fe/normalizers'; +import type { ChatMessage as ChatMessageEntity } from 'pl-fe/normalizers/chat-message'; const messages = defineMessages({ copy: { id: 'chats.actions.copy', defaultMessage: 'Copy' }, diff --git a/packages/pl-fe/src/features/community-timeline/index.tsx b/packages/pl-fe/src/features/community-timeline/index.tsx index 075e8463b1..3a63f6ff33 100644 --- a/packages/pl-fe/src/features/community-timeline/index.tsx +++ b/packages/pl-fe/src/features/community-timeline/index.tsx @@ -6,9 +6,9 @@ import { useCommunityStream } from 'pl-fe/api/hooks/streaming/useCommunityStream import PullToRefresh from 'pl-fe/components/pull-to-refresh'; import Column from 'pl-fe/components/ui/column'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/draft-statuses/builder.tsx b/packages/pl-fe/src/features/draft-statuses/builder.tsx index c93f34c3a9..c456e39b47 100644 --- a/packages/pl-fe/src/features/draft-statuses/builder.tsx +++ b/packages/pl-fe/src/features/draft-statuses/builder.tsx @@ -2,7 +2,7 @@ import { statusSchema } from 'pl-api'; import * as v from 'valibot'; import { Entities } from 'pl-fe/entity-store/entities'; -import { normalizeStatus } from 'pl-fe/normalizers'; +import { normalizeStatus } from 'pl-fe/normalizers/status'; import type { DraftStatus } from 'pl-fe/reducers/draft-statuses'; import type { RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx b/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx index 043251f96d..d8f828ec01 100644 --- a/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx +++ b/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx @@ -9,7 +9,7 @@ import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useModalsStore } from 'pl-fe/stores/modals'; import { useSettingsStore } from 'pl-fe/stores/settings'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; import type { DraftStatus } from 'pl-fe/reducers/draft-statuses'; const messages = defineMessages({ diff --git a/packages/pl-fe/src/features/draft-statuses/components/draft-status.tsx b/packages/pl-fe/src/features/draft-statuses/components/draft-status.tsx index 76761bdf32..ff91da7980 100644 --- a/packages/pl-fe/src/features/draft-statuses/components/draft-status.tsx +++ b/packages/pl-fe/src/features/draft-statuses/components/draft-status.tsx @@ -16,7 +16,7 @@ import { buildStatus } from '../builder'; import DraftStatusActionBar from './draft-status-action-bar'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; import type { DraftStatus as DraftStatusType } from 'pl-fe/reducers/draft-statuses'; interface IDraftStatus { diff --git a/packages/pl-fe/src/features/edit-profile/index.tsx b/packages/pl-fe/src/features/edit-profile/index.tsx index 3ab63eb599..1820174b15 100644 --- a/packages/pl-fe/src/features/edit-profile/index.tsx +++ b/packages/pl-fe/src/features/edit-profile/index.tsx @@ -17,12 +17,12 @@ import Input from 'pl-fe/components/ui/input'; import Streamfield from 'pl-fe/components/ui/streamfield'; import Textarea from 'pl-fe/components/ui/textarea'; import Toggle from 'pl-fe/components/ui/toggle'; +import { useImageField } from 'pl-fe/hooks/forms/useImageField'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; -import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import { useImageField } from 'pl-fe/hooks/forms/useImageField'; +import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; import toast from 'pl-fe/toast'; import { isDefaultAvatar, isDefaultHeader } from 'pl-fe/utils/accounts'; diff --git a/packages/pl-fe/src/features/event/components/event-action-button.tsx b/packages/pl-fe/src/features/event/components/event-action-button.tsx index 73a0cb1b94..f0d7ee84e8 100644 --- a/packages/pl-fe/src/features/event/components/event-action-button.tsx +++ b/packages/pl-fe/src/features/event/components/event-action-button.tsx @@ -8,7 +8,7 @@ import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useModalsStore } from 'pl-fe/stores/modals'; import type { ButtonThemes } from 'pl-fe/components/ui/button/useButtonStyles'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; const messages = defineMessages({ leaveHeading: { id: 'confirmations.leave_event.heading', defaultMessage: 'Leave event' }, diff --git a/packages/pl-fe/src/features/event/event-information.tsx b/packages/pl-fe/src/features/event/event-information.tsx index f71f263924..533859b6b8 100644 --- a/packages/pl-fe/src/features/event/event-information.tsx +++ b/packages/pl-fe/src/features/event/event-information.tsx @@ -17,7 +17,7 @@ import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; import { makeGetStatus } from 'pl-fe/selectors'; import { useModalsStore } from 'pl-fe/stores/modals'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; type RouteParams = { statusId: string }; diff --git a/packages/pl-fe/src/features/group/components/group-action-button.test.tsx b/packages/pl-fe/src/features/group/components/group-action-button.test.tsx index 1cbacb0838..55d8be5b90 100644 --- a/packages/pl-fe/src/features/group/components/group-action-button.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-action-button.test.tsx @@ -3,10 +3,12 @@ import React from 'react'; import { buildGroup, buildGroupRelationship } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupActionButton from './group-action-button'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/components/group-header.test.tsx b/packages/pl-fe/src/features/group/components/group-header.test.tsx index e93d19a5f9..d001685c92 100644 --- a/packages/pl-fe/src/features/group/components/group-header.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-header.test.tsx @@ -2,10 +2,12 @@ import React from 'react'; import { buildGroup } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupHeader from './group-header'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/components/group-member-count.test.tsx b/packages/pl-fe/src/features/group/components/group-member-count.test.tsx index e5be202ba4..bd64fd1c0f 100644 --- a/packages/pl-fe/src/features/group/components/group-member-count.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-member-count.test.tsx @@ -2,10 +2,12 @@ import React from 'react'; import { buildGroup } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupMemberCount from './group-member-count'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/components/group-member-list-item.tsx b/packages/pl-fe/src/features/group/components/group-member-list-item.tsx index d228eadb83..8191c776a0 100644 --- a/packages/pl-fe/src/features/group/components/group-member-list-item.tsx +++ b/packages/pl-fe/src/features/group/components/group-member-list-item.tsx @@ -19,7 +19,8 @@ import { useModalsStore } from 'pl-fe/stores/modals'; import toast from 'pl-fe/toast'; import type { Menu as IMenu } from 'pl-fe/components/dropdown-menu'; -import type { Group, GroupMember } from 'pl-fe/normalizers'; +import type { Group } from 'pl-fe/normalizers/group'; +import type { GroupMember } from 'pl-fe/normalizers/group-member'; const messages = defineMessages({ adminLimitTitle: { id: 'group.member.admin.limit.title', defaultMessage: 'Admin limit reached' }, diff --git a/packages/pl-fe/src/features/group/components/group-options-button.test.tsx b/packages/pl-fe/src/features/group/components/group-options-button.test.tsx index 22c8965918..a93718b900 100644 --- a/packages/pl-fe/src/features/group/components/group-options-button.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-options-button.test.tsx @@ -3,10 +3,12 @@ import React from 'react'; import { buildGroup, buildGroupRelationship } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupOptionsButton from './group-options-button'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/components/group-privacy.test.tsx b/packages/pl-fe/src/features/group/components/group-privacy.test.tsx index 2fa63e26fa..06de516c61 100644 --- a/packages/pl-fe/src/features/group/components/group-privacy.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-privacy.test.tsx @@ -2,10 +2,12 @@ import React from 'react'; import { buildGroup } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupPrivacy from './group-privacy'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/components/group-privacy.tsx b/packages/pl-fe/src/features/group/components/group-privacy.tsx index 16ccc010f7..635716b0dd 100644 --- a/packages/pl-fe/src/features/group/components/group-privacy.tsx +++ b/packages/pl-fe/src/features/group/components/group-privacy.tsx @@ -6,7 +6,8 @@ import Icon from 'pl-fe/components/ui/icon'; import Popover from 'pl-fe/components/ui/popover'; import Stack from 'pl-fe/components/ui/stack'; import Text from 'pl-fe/components/ui/text'; -import { Group } from 'pl-fe/normalizers'; + +import type { Group } from 'pl-fe/normalizers/group'; interface IGroupPolicy { group: Pick; diff --git a/packages/pl-fe/src/features/group/components/group-relationship.test.tsx b/packages/pl-fe/src/features/group/components/group-relationship.test.tsx index db5a21aa10..e62f64af37 100644 --- a/packages/pl-fe/src/features/group/components/group-relationship.test.tsx +++ b/packages/pl-fe/src/features/group/components/group-relationship.test.tsx @@ -3,10 +3,12 @@ import React from 'react'; import { buildGroup, buildGroupRelationship } from 'pl-fe/jest/factory'; import { render, screen } from 'pl-fe/jest/test-helpers'; -import { Group } from 'pl-fe/normalizers'; import GroupRelationship from './group-relationship'; +import type { Group } from 'pl-fe/normalizers/group'; + + let group: Group; describe('', () => { diff --git a/packages/pl-fe/src/features/group/group-membership-requests.tsx b/packages/pl-fe/src/features/group/group-membership-requests.tsx index 24c037fed9..024b9a2889 100644 --- a/packages/pl-fe/src/features/group/group-membership-requests.tsx +++ b/packages/pl-fe/src/features/group/group-membership-requests.tsx @@ -16,7 +16,7 @@ import toast from 'pl-fe/toast'; import ColumnForbidden from '../ui/components/column-forbidden'; import type { PlfeResponse } from 'pl-fe/api'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; type RouteParams = { groupId: string }; diff --git a/packages/pl-fe/src/features/hashtag-timeline/index.tsx b/packages/pl-fe/src/features/hashtag-timeline/index.tsx index d7fde18b0d..35715e7107 100644 --- a/packages/pl-fe/src/features/hashtag-timeline/index.tsx +++ b/packages/pl-fe/src/features/hashtag-timeline/index.tsx @@ -11,9 +11,9 @@ import Timeline from 'pl-fe/features/ui/components/timeline'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; +import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; interface IHashtagTimeline { params?: { diff --git a/packages/pl-fe/src/features/home-timeline/index.tsx b/packages/pl-fe/src/features/home-timeline/index.tsx index 9400f68e4e..71a74f0e40 100644 --- a/packages/pl-fe/src/features/home-timeline/index.tsx +++ b/packages/pl-fe/src/features/home-timeline/index.tsx @@ -8,12 +8,12 @@ import Column from 'pl-fe/components/ui/column'; import Stack from 'pl-fe/components/ui/stack'; import Text from 'pl-fe/components/ui/text'; import Timeline from 'pl-fe/features/ui/components/timeline'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { useTheme } from 'pl-fe/hooks/useTheme'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; const messages = defineMessages({ title: { id: 'column.home', defaultMessage: 'Home' }, diff --git a/packages/pl-fe/src/features/landing-timeline/index.tsx b/packages/pl-fe/src/features/landing-timeline/index.tsx index f1972cd137..5e558e7fb6 100644 --- a/packages/pl-fe/src/features/landing-timeline/index.tsx +++ b/packages/pl-fe/src/features/landing-timeline/index.tsx @@ -7,8 +7,8 @@ import PullToRefresh from 'pl-fe/components/pull-to-refresh'; import Column from 'pl-fe/components/ui/column'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { useTheme } from 'pl-fe/hooks/useTheme'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; import AboutPage from '../about'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/list-timeline/index.tsx b/packages/pl-fe/src/features/list-timeline/index.tsx index 5aacead18c..f4794c400a 100644 --- a/packages/pl-fe/src/features/list-timeline/index.tsx +++ b/packages/pl-fe/src/features/list-timeline/index.tsx @@ -12,8 +12,8 @@ import Column from 'pl-fe/components/ui/column'; import Spinner from 'pl-fe/components/ui/spinner'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import { useTheme } from 'pl-fe/hooks/useTheme'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; import { useModalsStore } from 'pl-fe/stores/modals'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/notifications/components/notification.tsx b/packages/pl-fe/src/features/notifications/components/notification.tsx index 2c2fc8f17f..fd4347c41e 100644 --- a/packages/pl-fe/src/features/notifications/components/notification.tsx +++ b/packages/pl-fe/src/features/notifications/components/notification.tsx @@ -24,7 +24,9 @@ import { useSettingsStore } from 'pl-fe/stores/settings'; import { NotificationType } from 'pl-fe/utils/notification'; import type { Notification as BaseNotification } from 'pl-api'; -import type { Account, Notification as NotificationEntity, Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Notification as NotificationEntity } from 'pl-fe/normalizers/notification'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; import type { MinifiedNotification } from 'pl-fe/reducers/notifications'; const notificationForScreenReader = (intl: IntlShape, message: string, timestamp: string) => { diff --git a/packages/pl-fe/src/features/pl-fe-config/components/site-preview.tsx b/packages/pl-fe/src/features/pl-fe-config/components/site-preview.tsx index 48988d8553..bb78fca479 100644 --- a/packages/pl-fe/src/features/pl-fe-config/components/site-preview.tsx +++ b/packages/pl-fe/src/features/pl-fe-config/components/site-preview.tsx @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl'; import BackgroundShapes from 'pl-fe/features/ui/components/background-shapes'; import { useSystemTheme } from 'pl-fe/hooks/useSystemTheme'; -import { normalizePlFeConfig } from 'pl-fe/normalizers'; +import { normalizePlFeConfig } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import { useSettingsStore } from 'pl-fe/stores/settings'; import { generateThemeCss } from 'pl-fe/utils/theme'; diff --git a/packages/pl-fe/src/features/pl-fe-config/index.tsx b/packages/pl-fe/src/features/pl-fe-config/index.tsx index 689519956c..23fd02c085 100644 --- a/packages/pl-fe/src/features/pl-fe-config/index.tsx +++ b/packages/pl-fe/src/features/pl-fe-config/index.tsx @@ -18,10 +18,10 @@ import Streamfield from 'pl-fe/components/ui/streamfield'; import Textarea from 'pl-fe/components/ui/textarea'; import Toggle from 'pl-fe/components/ui/toggle'; import ThemeSelector from 'pl-fe/features/ui/components/theme-selector'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; -import { normalizePlFeConfig } from 'pl-fe/normalizers'; +import { normalizePlFeConfig } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import toast from 'pl-fe/toast'; import CryptoAddressInput from './components/crypto-address-input'; diff --git a/packages/pl-fe/src/features/public-timeline/index.tsx b/packages/pl-fe/src/features/public-timeline/index.tsx index 98b601e096..d6b387c1eb 100644 --- a/packages/pl-fe/src/features/public-timeline/index.tsx +++ b/packages/pl-fe/src/features/public-timeline/index.tsx @@ -10,9 +10,9 @@ import Accordion from 'pl-fe/components/ui/accordion'; import Column from 'pl-fe/components/ui/column'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useInstance } from 'pl-fe/hooks/useInstance'; +import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import PinnedHostsPicker from '../remote-timeline/components/pinned-hosts-picker'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/quotes/index.tsx b/packages/pl-fe/src/features/quotes/index.tsx index 687814a212..715b00ee6d 100644 --- a/packages/pl-fe/src/features/quotes/index.tsx +++ b/packages/pl-fe/src/features/quotes/index.tsx @@ -9,8 +9,8 @@ import StatusList from 'pl-fe/components/status-list'; import Column from 'pl-fe/components/ui/column'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import { useTheme } from 'pl-fe/hooks/useTheme'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; const messages = defineMessages({ heading: { id: 'column.quotes', defaultMessage: 'Post quotes' }, diff --git a/packages/pl-fe/src/features/remote-timeline/index.tsx b/packages/pl-fe/src/features/remote-timeline/index.tsx index f460fcbeba..15c334819a 100644 --- a/packages/pl-fe/src/features/remote-timeline/index.tsx +++ b/packages/pl-fe/src/features/remote-timeline/index.tsx @@ -9,9 +9,9 @@ import Column from 'pl-fe/components/ui/column'; import HStack from 'pl-fe/components/ui/hstack'; import Text from 'pl-fe/components/ui/text'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; import Timeline from '../ui/components/timeline'; diff --git a/packages/pl-fe/src/features/scheduled-statuses/components/scheduled-status-action-bar.tsx b/packages/pl-fe/src/features/scheduled-statuses/components/scheduled-status-action-bar.tsx index 38393a0e75..d7efac1e5b 100644 --- a/packages/pl-fe/src/features/scheduled-statuses/components/scheduled-status-action-bar.tsx +++ b/packages/pl-fe/src/features/scheduled-statuses/components/scheduled-status-action-bar.tsx @@ -8,7 +8,7 @@ import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useModalsStore } from 'pl-fe/stores/modals'; import { useSettingsStore } from 'pl-fe/stores/settings'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; const messages = defineMessages({ cancel: { id: 'scheduled_status.cancel', defaultMessage: 'Cancel' }, diff --git a/packages/pl-fe/src/features/status/components/thread.tsx b/packages/pl-fe/src/features/status/components/thread.tsx index 1a91d82145..9685c0d8eb 100644 --- a/packages/pl-fe/src/features/status/components/thread.tsx +++ b/packages/pl-fe/src/features/status/components/thread.tsx @@ -27,7 +27,8 @@ import DetailedStatus from './detailed-status'; import ThreadStatus from './thread-status'; import type { Virtualizer } from '@tanstack/react-virtual'; -import type { Account, Status } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Status } from 'pl-fe/normalizers/status'; import type { SelectedStatus } from 'pl-fe/selectors'; const getAncestorsIds = createSelector([ diff --git a/packages/pl-fe/src/features/test-timeline/index.tsx b/packages/pl-fe/src/features/test-timeline/index.tsx index d7f47db3ac..564f105d36 100644 --- a/packages/pl-fe/src/features/test-timeline/index.tsx +++ b/packages/pl-fe/src/features/test-timeline/index.tsx @@ -6,8 +6,8 @@ import { expandTimelineSuccess } from 'pl-fe/actions/timelines'; import Column from 'pl-fe/components/ui/column'; import Timeline from 'pl-fe/features/ui/components/timeline'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; -import { useTheme } from 'pl-fe/hooks/useTheme'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useTheme } from 'pl-fe/hooks/useTheme'; const messages = defineMessages({ title: { id: 'column.test', defaultMessage: 'Test timeline' }, diff --git a/packages/pl-fe/src/features/theme-editor/index.tsx b/packages/pl-fe/src/features/theme-editor/index.tsx index 11c480fb19..2bd5384d37 100644 --- a/packages/pl-fe/src/features/theme-editor/index.tsx +++ b/packages/pl-fe/src/features/theme-editor/index.tsx @@ -14,7 +14,7 @@ import ColorPicker from 'pl-fe/features/pl-fe-config/components/color-picker'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; -import { normalizePlFeConfig } from 'pl-fe/normalizers'; +import { normalizePlFeConfig } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import toast from 'pl-fe/toast'; import { download } from 'pl-fe/utils/download'; diff --git a/packages/pl-fe/src/features/ui/components/modals/account-moderation-modal/staff-role-picker.tsx b/packages/pl-fe/src/features/ui/components/modals/account-moderation-modal/staff-role-picker.tsx index 3da2c018f8..ea15a97222 100644 --- a/packages/pl-fe/src/features/ui/components/modals/account-moderation-modal/staff-role-picker.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/account-moderation-modal/staff-role-picker.tsx @@ -6,7 +6,7 @@ import { SelectDropdown } from 'pl-fe/features/forms'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import toast from 'pl-fe/toast'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; /** Staff role. */ type AccountRole = 'user' | 'moderator' | 'admin'; diff --git a/packages/pl-fe/src/features/ui/components/modals/boost-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/boost-modal.tsx index 4eedf11acb..48fa0e000e 100644 --- a/packages/pl-fe/src/features/ui/components/modals/boost-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/boost-modal.tsx @@ -10,7 +10,7 @@ import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { makeGetStatus } from 'pl-fe/selectors'; import type { BaseModalProps } from '../modal-root'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; const messages = defineMessages({ cancel_reblog: { id: 'status.cancel_reblog_private', defaultMessage: 'Un-repost' }, diff --git a/packages/pl-fe/src/features/ui/components/modals/manage-group-modal/steps/details-step.tsx b/packages/pl-fe/src/features/ui/components/modals/manage-group-modal/steps/details-step.tsx index 0ff9f28993..5073a1145a 100644 --- a/packages/pl-fe/src/features/ui/components/modals/manage-group-modal/steps/details-step.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/manage-group-modal/steps/details-step.tsx @@ -7,9 +7,9 @@ import Input from 'pl-fe/components/ui/input'; import Textarea from 'pl-fe/components/ui/textarea'; import AvatarPicker from 'pl-fe/features/edit-profile/components/avatar-picker'; import HeaderPicker from 'pl-fe/features/edit-profile/components/header-picker'; +import { usePreview } from 'pl-fe/hooks/forms/usePreview'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { usePreview } from 'pl-fe/hooks/forms/usePreview'; import resizeImage from 'pl-fe/utils/resize-image'; import type { CreateGroupParams } from 'pl-api'; diff --git a/packages/pl-fe/src/features/ui/components/modals/select-bookmark-folder-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/select-bookmark-folder-modal.tsx index 589aa3f056..02d6e61a44 100644 --- a/packages/pl-fe/src/features/ui/components/modals/select-bookmark-folder-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/select-bookmark-folder-modal.tsx @@ -16,7 +16,7 @@ import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { makeGetStatus } from 'pl-fe/selectors'; import type { BaseModalProps } from '../modal-root'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; interface SelectBookmarkFolderModalProps { statusId: string; diff --git a/packages/pl-fe/src/features/ui/components/modals/unauthorized-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/unauthorized-modal.tsx index 4f3a09ba93..cafdec04e7 100644 --- a/packages/pl-fe/src/features/ui/components/modals/unauthorized-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/unauthorized-modal.tsx @@ -9,8 +9,8 @@ import Input from 'pl-fe/components/ui/input'; import Modal from 'pl-fe/components/ui/modal'; import Stack from 'pl-fe/components/ui/stack'; import Text from 'pl-fe/components/ui/text'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; import { useRegistrationStatus } from 'pl-fe/hooks/useRegistrationStatus'; diff --git a/packages/pl-fe/src/features/ui/components/panels/account-note-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/account-note-panel.tsx index 6403153aba..109c97e04c 100644 --- a/packages/pl-fe/src/features/ui/components/panels/account-note-panel.tsx +++ b/packages/pl-fe/src/features/ui/components/panels/account-note-panel.tsx @@ -10,7 +10,7 @@ import Widget from 'pl-fe/components/ui/widget'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; import type { AppDispatch } from 'pl-fe/store'; const onSave = debounce( diff --git a/packages/pl-fe/src/features/ui/components/panels/instance-info-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/instance-info-panel.tsx index beb270f576..63657ebc73 100644 --- a/packages/pl-fe/src/features/ui/components/panels/instance-info-panel.tsx +++ b/packages/pl-fe/src/features/ui/components/panels/instance-info-panel.tsx @@ -3,8 +3,8 @@ import { useIntl, defineMessages } from 'react-intl'; import { pinHost, unpinHost } from 'pl-fe/actions/remote-timeline'; import Widget from 'pl-fe/components/ui/widget'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { makeGetRemoteInstance } from 'pl-fe/selectors'; diff --git a/packages/pl-fe/src/features/ui/components/panels/promo-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/promo-panel.tsx index cade1c4a37..26431e027d 100644 --- a/packages/pl-fe/src/features/ui/components/panels/promo-panel.tsx +++ b/packages/pl-fe/src/features/ui/components/panels/promo-panel.tsx @@ -5,8 +5,8 @@ import List, { ListItem } from 'pl-fe/components/list'; import HStack from 'pl-fe/components/ui/hstack'; import Widget from 'pl-fe/components/ui/widget'; import { useInstance } from 'pl-fe/hooks/useInstance'; -import { useSettings } from 'pl-fe/hooks/useSettings'; import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; +import { useSettings } from 'pl-fe/hooks/useSettings'; const PromoPanel: React.FC = () => { const instance = useInstance(); diff --git a/packages/pl-fe/src/features/ui/components/panels/who-to-follow-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/who-to-follow-panel.tsx index a4c607ab12..965c6dd8d7 100644 --- a/packages/pl-fe/src/features/ui/components/panels/who-to-follow-panel.tsx +++ b/packages/pl-fe/src/features/ui/components/panels/who-to-follow-panel.tsx @@ -9,7 +9,7 @@ import PlaceholderSidebarSuggestions from 'pl-fe/features/placeholder/components import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useDismissSuggestion, useSuggestions } from 'pl-fe/queries/suggestions'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; const messages = defineMessages({ dismissSuggestion: { id: 'suggestions.dismiss', defaultMessage: 'Dismiss suggestion' }, diff --git a/packages/pl-fe/src/features/ui/components/pending-status.tsx b/packages/pl-fe/src/features/ui/components/pending-status.tsx index 8152853126..11ad0d6efb 100644 --- a/packages/pl-fe/src/features/ui/components/pending-status.tsx +++ b/packages/pl-fe/src/features/ui/components/pending-status.tsx @@ -16,7 +16,7 @@ import { buildStatus } from '../util/pending-status-builder'; import PollPreview from './poll-preview'; -import type { Status as StatusEntity } from 'pl-fe/normalizers'; +import type { Status as StatusEntity } from 'pl-fe/normalizers/status'; const shouldHaveCard = (pendingStatus: StatusEntity) => Boolean(pendingStatus.content.match(/https?:\/\/\S*/)); diff --git a/packages/pl-fe/src/features/ui/components/profile-dropdown.tsx b/packages/pl-fe/src/features/ui/components/profile-dropdown.tsx index 681d26d34c..bbb6efc3df 100644 --- a/packages/pl-fe/src/features/ui/components/profile-dropdown.tsx +++ b/packages/pl-fe/src/features/ui/components/profile-dropdown.tsx @@ -14,7 +14,7 @@ import { makeGetAccount } from 'pl-fe/selectors'; import ThemeToggle from './theme-toggle'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; const messages = defineMessages({ add: { id: 'profile_dropdown.add_account', defaultMessage: 'Add an existing account' }, diff --git a/packages/pl-fe/src/features/ui/components/subscription-button.tsx b/packages/pl-fe/src/features/ui/components/subscription-button.tsx index 99c0938325..2acc41f382 100644 --- a/packages/pl-fe/src/features/ui/components/subscription-button.tsx +++ b/packages/pl-fe/src/features/ui/components/subscription-button.tsx @@ -6,7 +6,7 @@ import IconButton from 'pl-fe/components/ui/icon-button'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import toast from 'pl-fe/toast'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; const messages = defineMessages({ subscribe: { id: 'account.subscribe', defaultMessage: 'Subscribe to notifications from @{name}' }, diff --git a/packages/pl-fe/src/features/ui/index.tsx b/packages/pl-fe/src/features/ui/index.tsx index 40c4076019..4f4ad87ca3 100644 --- a/packages/pl-fe/src/features/ui/index.tsx +++ b/packages/pl-fe/src/features/ui/index.tsx @@ -19,12 +19,12 @@ import ThumbNavigation from 'pl-fe/components/thumb-navigation'; import Layout from 'pl-fe/components/ui/layout'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; -import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; -import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useDraggedFiles } from 'pl-fe/hooks/useDraggedFiles'; +import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useInstance } from 'pl-fe/hooks/useInstance'; import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn'; +import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; +import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; import AdminLayout from 'pl-fe/layouts/admin-layout'; import ChatsLayout from 'pl-fe/layouts/chats-layout'; import DefaultLayout from 'pl-fe/layouts/default-layout'; diff --git a/packages/pl-fe/src/init/pl-fe-head.tsx b/packages/pl-fe/src/init/pl-fe-head.tsx index 8a496880c5..905c015107 100644 --- a/packages/pl-fe/src/init/pl-fe-head.tsx +++ b/packages/pl-fe/src/init/pl-fe-head.tsx @@ -5,7 +5,7 @@ import { useLocale } from 'pl-fe/hooks/useLocale'; import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; import { useSettings } from 'pl-fe/hooks/useSettings'; import { useTheme } from 'pl-fe/hooks/useTheme'; -import { normalizePlFeConfig } from 'pl-fe/normalizers'; +import { normalizePlFeConfig } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import { startSentry } from 'pl-fe/sentry'; import { useModalsStore } from 'pl-fe/stores/modals'; import { generateThemeCss } from 'pl-fe/utils/theme'; diff --git a/packages/pl-fe/src/layouts/home-layout.tsx b/packages/pl-fe/src/layouts/home-layout.tsx index caafe09471..8a129abddd 100644 --- a/packages/pl-fe/src/layouts/home-layout.tsx +++ b/packages/pl-fe/src/layouts/home-layout.tsx @@ -19,13 +19,13 @@ import { BirthdayPanel, AnnouncementsPanel, } from 'pl-fe/features/ui/util/async-components'; -import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; -import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; -import { useFeatures } from 'pl-fe/hooks/useFeatures'; -import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; -import { useDraggedFiles } from 'pl-fe/hooks/useDraggedFiles'; import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; +import { useAppSelector } from 'pl-fe/hooks/useAppSelector'; +import { useDraggedFiles } from 'pl-fe/hooks/useDraggedFiles'; +import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useIsMobile } from 'pl-fe/hooks/useIsMobile'; +import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; +import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig'; interface IHomeLayout { children: React.ReactNode; diff --git a/packages/pl-fe/src/normalizers/index.ts b/packages/pl-fe/src/normalizers/index.ts deleted file mode 100644 index 00c473a467..0000000000 --- a/packages/pl-fe/src/normalizers/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { normalizeAccount, type Account } from './account'; -export { normalizeAdminReport, type AdminReport } from './admin-report'; -export { normalizeAnnouncement, type AdminAnnouncement, type Announcement } from './announcement'; -export { normalizeChatMessage, type ChatMessage } from './chat-message'; -export { normalizeGroup, type Group } from './group'; -export { normalizeGroupMember, type GroupMember } from './group-member'; -export { normalizeNotification, normalizeNotifications, type Notification } from './notification'; -export { normalizePoll, normalizePollEdit, type Poll, type PollEdit } from './poll'; -export { normalizeStatus, type Status } from './status'; -export { normalizeStatusEdit, type StatusEdit } from './status-edit'; -export { normalizeTranslation, type Translation } from './translation'; - -export { PlFeConfigRecord, normalizePlFeConfig } from './pl-fe/pl-fe-config'; diff --git a/packages/pl-fe/src/queries/chats.test.ts b/packages/pl-fe/src/queries/chats.test.ts index 6e044bb920..dbee2ffa06 100644 --- a/packages/pl-fe/src/queries/chats.test.ts +++ b/packages/pl-fe/src/queries/chats.test.ts @@ -5,7 +5,7 @@ import { useEffect } from 'react'; import { __stub } from 'pl-fe/api'; import { buildAccount, buildRelationship } from 'pl-fe/jest/factory'; import { createTestStore, mockStore, queryClient, renderHook, rootState, waitFor } from 'pl-fe/jest/test-helpers'; -import { normalizeChatMessage } from 'pl-fe/normalizers'; +import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message'; import { Store } from 'pl-fe/store'; import { flattenPages } from 'pl-fe/utils/queries'; diff --git a/packages/pl-fe/src/queries/chats.ts b/packages/pl-fe/src/queries/chats.ts index a43065f3e5..1ad2bb1f35 100644 --- a/packages/pl-fe/src/queries/chats.ts +++ b/packages/pl-fe/src/queries/chats.ts @@ -13,7 +13,7 @@ import { useClient } from 'pl-fe/hooks/useClient'; import { useFeatures } from 'pl-fe/hooks/useFeatures'; import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn'; import { useOwnAccount } from 'pl-fe/hooks/useOwnAccount'; -import { type ChatMessage, normalizeChatMessage } from 'pl-fe/normalizers'; +import { type ChatMessage, normalizeChatMessage } from 'pl-fe/normalizers/chat-message'; import { reOrderChatListItems } from 'pl-fe/utils/chats'; import { flattenPages, updatePageItem } from 'pl-fe/utils/queries'; diff --git a/packages/pl-fe/src/reducers/auth.ts b/packages/pl-fe/src/reducers/auth.ts index 48559b8c57..114e6958b2 100644 --- a/packages/pl-fe/src/reducers/auth.ts +++ b/packages/pl-fe/src/reducers/auth.ts @@ -20,7 +20,7 @@ import { import { ME_FETCH_SKIP } from '../actions/me'; import type { PlfeResponse } from 'pl-fe/api'; -import type { Account as AccountEntity } from 'pl-fe/normalizers'; +import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; import type { AnyAction } from 'redux'; const backendUrl = (isURL(BuildConfig.BACKEND_URL) ? BuildConfig.BACKEND_URL : ''); diff --git a/packages/pl-fe/src/reducers/compose.test.ts b/packages/pl-fe/src/reducers/compose.test.ts index 47b56c9505..8251fb6b89 100644 --- a/packages/pl-fe/src/reducers/compose.test.ts +++ b/packages/pl-fe/src/reducers/compose.test.ts @@ -4,7 +4,6 @@ import * as actions from 'pl-fe/actions/compose'; import { ME_FETCH_SUCCESS, ME_PATCH_SUCCESS } from 'pl-fe/actions/me'; import { SETTING_CHANGE } from 'pl-fe/actions/settings'; import { TIMELINE_DELETE } from 'pl-fe/actions/timelines'; -import { TagRecord } from 'pl-fe/normalizers'; import { normalizeStatus } from 'pl-fe/normalizers/status'; import reducer, { initialState, ReducerCompose } from './compose'; @@ -382,7 +381,7 @@ describe('compose reducer', () => { id: 'home', token: 'aaadken3', tags: ImmutableList([ - TagRecord({ name: 'hashtag' }), + { name: 'hashtag', url: '', history: null }, ]), }; expect(reducer(state, action).toJS().home).toMatchObject({ diff --git a/packages/pl-fe/src/reducers/compose.ts b/packages/pl-fe/src/reducers/compose.ts index 665f235755..a8704dfb4a 100644 --- a/packages/pl-fe/src/reducers/compose.ts +++ b/packages/pl-fe/src/reducers/compose.ts @@ -68,7 +68,8 @@ import { unescapeHTML } from '../utils/html'; import type { Emoji } from 'pl-fe/features/emoji'; import type { Language } from 'pl-fe/features/preferences'; -import type { Account, Status } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Status } from 'pl-fe/normalizers/status'; import type { APIEntity } from 'pl-fe/types/entities'; const getResetFileKey = () => Math.floor((Math.random() * 0x10000)); diff --git a/packages/pl-fe/src/reducers/history.ts b/packages/pl-fe/src/reducers/history.ts index 169e40cb13..42548c9b97 100644 --- a/packages/pl-fe/src/reducers/history.ts +++ b/packages/pl-fe/src/reducers/history.ts @@ -1,7 +1,7 @@ import { Map as ImmutableMap, Record as ImmutableRecord } from 'immutable'; import { HISTORY_FETCH_REQUEST, HISTORY_FETCH_SUCCESS, HISTORY_FETCH_FAIL, type HistoryAction } from 'pl-fe/actions/history'; -import { normalizeStatusEdit } from 'pl-fe/normalizers'; +import { normalizeStatusEdit } from 'pl-fe/normalizers/status-edit'; import type { StatusEdit as BaseStatusEdit } from 'pl-api'; diff --git a/packages/pl-fe/src/reducers/polls.ts b/packages/pl-fe/src/reducers/polls.ts index b9eaa557dd..27102d1183 100644 --- a/packages/pl-fe/src/reducers/polls.ts +++ b/packages/pl-fe/src/reducers/polls.ts @@ -1,7 +1,7 @@ import { Map as ImmutableMap } from 'immutable'; import { POLLS_IMPORT } from 'pl-fe/actions/importer'; -import { normalizePoll } from 'pl-fe/normalizers'; +import { normalizePoll } from 'pl-fe/normalizers/poll'; import type { Status } from 'pl-api'; import type { AnyAction } from 'redux'; diff --git a/packages/pl-fe/src/reducers/statuses.test.ts b/packages/pl-fe/src/reducers/statuses.test.ts index 5f485f87aa..4bf2877455 100644 --- a/packages/pl-fe/src/reducers/statuses.test.ts +++ b/packages/pl-fe/src/reducers/statuses.test.ts @@ -10,7 +10,7 @@ import { STATUS_DELETE_REQUEST, STATUS_DELETE_FAIL, } from 'pl-fe/actions/statuses'; -import { normalizeStatus } from 'pl-fe/normalizers'; +import { normalizeStatus } from 'pl-fe/normalizers/status'; import reducer, { ReducerStatus } from './statuses'; diff --git a/packages/pl-fe/src/reducers/statuses.ts b/packages/pl-fe/src/reducers/statuses.ts index e0c66e39b6..4aa2d5cfdf 100644 --- a/packages/pl-fe/src/reducers/statuses.ts +++ b/packages/pl-fe/src/reducers/statuses.ts @@ -1,7 +1,8 @@ import { Map as ImmutableMap } from 'immutable'; import omit from 'lodash/omit'; -import { normalizeStatus, normalizeTranslation, Status as StatusRecord } from 'pl-fe/normalizers'; +import { normalizeStatus, Status as StatusRecord } from 'pl-fe/normalizers/status'; +import { normalizeTranslation } from 'pl-fe/normalizers/translation'; import { simulateEmojiReact, simulateUnEmojiReact } from 'pl-fe/utils/emoji-reacts'; import { diff --git a/packages/pl-fe/src/selectors/index.ts b/packages/pl-fe/src/selectors/index.ts index 4b42e0ea02..f721cfe1b0 100644 --- a/packages/pl-fe/src/selectors/index.ts +++ b/packages/pl-fe/src/selectors/index.ts @@ -15,7 +15,9 @@ import { shouldFilter } from 'pl-fe/utils/timelines'; import type { Account as BaseAccount, Filter, MediaAttachment, Relationship } from 'pl-api'; import type { EntityStore } from 'pl-fe/entity-store/types'; -import type { Account, Group, Notification } from 'pl-fe/normalizers'; +import type { Account } from 'pl-fe/normalizers/account'; +import type { Group } from 'pl-fe/normalizers/group'; +import type { Notification } from 'pl-fe/normalizers/notification'; import type { MinifiedNotification } from 'pl-fe/reducers/notifications'; import type { MinifiedStatus } from 'pl-fe/reducers/statuses'; import type { MRFSimple } from 'pl-fe/schemas/pleroma'; diff --git a/packages/pl-fe/src/utils/accounts.test.ts b/packages/pl-fe/src/utils/accounts.test.ts index caf5e22b70..4177556b9c 100644 --- a/packages/pl-fe/src/utils/accounts.test.ts +++ b/packages/pl-fe/src/utils/accounts.test.ts @@ -1,4 +1,4 @@ -import { AccountRecord } from 'pl-fe/normalizers'; +import { AccountRecord } from 'pl-fe/normalizers/account'; import { getDomain, diff --git a/packages/pl-fe/src/utils/chats.test.ts b/packages/pl-fe/src/utils/chats.test.ts index f6eb55a560..c4c660bd01 100644 --- a/packages/pl-fe/src/utils/chats.test.ts +++ b/packages/pl-fe/src/utils/chats.test.ts @@ -1,5 +1,5 @@ import { buildAccount } from 'pl-fe/jest/factory'; -import { normalizeChatMessage } from 'pl-fe/normalizers'; +import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message'; import { ChatKeys, IChat } from 'pl-fe/queries/chats'; import { queryClient } from 'pl-fe/queries/client'; diff --git a/packages/pl-fe/src/utils/chats.ts b/packages/pl-fe/src/utils/chats.ts index 836982714a..391fefc04b 100644 --- a/packages/pl-fe/src/utils/chats.ts +++ b/packages/pl-fe/src/utils/chats.ts @@ -1,6 +1,6 @@ import sumBy from 'lodash/sumBy'; -import { normalizeChatMessage } from 'pl-fe/normalizers'; +import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message'; import { ChatKeys } from 'pl-fe/queries/chats'; import { queryClient } from 'pl-fe/queries/client';