Merge branch 'develop' into frontend-rw

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-26 00:10:17 +02:00
commit 52548c8403
533 changed files with 5676 additions and 1961 deletions

41
.github/workflows/pl-hooks.yaml vendored Normal file
View file

@ -0,0 +1,41 @@
name: pl-hooks CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
name: Test for a successful build
strategy:
matrix:
node-version: [21.x]
steps:
- name: Install system dependencies
run: sudo apt install -y unzip
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
working-directory: ./packages/pl-hooks
run: yarn install --ignore-scripts
- name: Lint
working-directory: ./packages/pl-hooks
run: yarn lint
- name: build
env:
NODE_ENV: production
working-directory: ./packages/pl-hooks
run: yarn build

View file

@ -2,6 +2,7 @@ This repo hosts a few of my projects related to the Fediverse client `pl-fe`. Th
- [pl-fe](./packages/pl-fe/) — a social networking client app forked from Soapbox
- [pl-api](./packages/pl-api) — a library for interacting with Mastodon API-compatible servers, focused on support for projects extending the official Mastodon API. It is used by `pl-fe`.
- [pl-hooks](./packages/pl-hooks) — a library including hooks for integrating with Mastodon API, based on `pl-api` and TanStack. It is intended to be used within `pl-fe`. Work in progress.
More projects to be announced.

View file

@ -7,6 +7,6 @@
"husky": "^9.0.0",
"lint-staged": ">=10"
},
"workspaces": ["pl-api", "pl-fe"],
"workspaces": ["pl-api", "pl-fe", "pl-hooks"],
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

View file

@ -6,10 +6,7 @@ import { relationshipSchema } from './relationship';
import { roleSchema } from './role';
import { coerceObject, datetimeSchema, filteredArray } from './utils';
const filterBadges = (tags?: string[]) =>
tags?.filter(tag => tag.startsWith('badge:')).map(tag => v.parse(roleSchema, { id: tag, name: tag.replace(/^badge:/, '') }));
const getDomainFromURL = (account: any): string => {
const getDomainFromURL = (account: Pick<Account, 'url'>): string => {
try {
const url = account.url;
return new URL(url).host;
@ -18,7 +15,7 @@ const getDomainFromURL = (account: any): string => {
}
};
const guessFqn = (account: any): string => {
const guessFqn = (account: Pick<Account, 'acct' | 'url'>): string => {
const acct = account.acct;
const [user, domain] = acct.split('@');
@ -29,6 +26,9 @@ const guessFqn = (account: any): string => {
}
};
const filterBadges = (tags?: string[]) =>
tags?.filter(tag => tag.startsWith('badge:')).map(tag => v.parse(roleSchema, { id: tag, name: tag.replace(/^badge:/, '') }));
const preprocessAccount = v.transform((account: any) => {
if (!account?.acct) return null;
@ -144,6 +144,7 @@ const baseAccountSchema = v.object({
header_description: v.fallback(v.string(), ''),
verified: v.fallback(v.optional(v.boolean()), undefined),
domain: v.fallback(v.string(), ''),
__meta: coerceObject({
pleroma: v.fallback(v.any(), undefined),

View file

@ -4,8 +4,10 @@ import { coerceObject } from './utils';
const interactionPolicyEntrySchema = v.picklist(['public', 'followers', 'following', 'mutuals', 'mentioned', 'author', 'me']);
type InteractionPolicyEntry = v.InferOutput<typeof interactionPolicyEntrySchema>;
const interactionPolicyRuleSchema = coerceObject({
always: v.fallback(v.array(interactionPolicyEntrySchema), ['public']),
always: v.fallback(v.array(interactionPolicyEntrySchema), ['public', 'me']),
with_approval: v.fallback(v.array(interactionPolicyEntrySchema), []),
});
@ -27,5 +29,5 @@ const interactionPoliciesSchema = coerceObject({
type InteractionPolicies = v.InferOutput<typeof interactionPoliciesSchema>;
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicy, type InteractionPolicies };
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicyEntry, type InteractionPolicy, type InteractionPolicies };

View file

@ -1,7 +1,7 @@
import pick from 'lodash.pick';
import * as v from 'valibot';
import { accountSchema } from './account';
import { type Account, accountSchema } from './account';
import { customEmojiSchema } from './custom-emoji';
import { emojiReactionSchema } from './emoji-reaction';
import { filterResultSchema } from './filter-result';
@ -19,7 +19,7 @@ const statusEventSchema = v.object({
name: v.fallback(v.string(), ''),
start_time: v.fallback(v.nullable(datetimeSchema), null),
end_time: v.fallback(v.nullable(datetimeSchema), null),
join_mode: v.fallback(v.nullable(v.picklist(['free', 'restricted', 'invite'])), null),
join_mode: v.fallback(v.nullable(v.picklist(['free', 'restricted', 'invite', 'external'])), null),
participants_count: v.fallback(v.number(), 0),
location: v.fallback(v.nullable(v.object({
name: v.fallback(v.string(), ''),
@ -41,7 +41,7 @@ const baseStatusSchema = v.object({
uri: v.fallback(v.pipe(v.string(), v.url()), ''),
created_at: v.fallback(datetimeSchema, new Date().toISOString()),
account: accountSchema,
content: v.fallback(v.string(), ''),
content: v.fallback(v.pipe(v.string(), v.transform((note => note === '<p></p>' ? '' : note))), ''),
visibility: v.fallback(v.string(), 'public'),
sensitive: v.pipe(v.unknown(), v.transform(Boolean)),
spoiler_text: v.fallback(v.string(), ''),
@ -149,9 +149,15 @@ const statusWithoutAccountSchema = v.pipe(v.any(), v.transform(preprocess), v.ob
quote: v.fallback(v.nullable(v.lazy(() => statusSchema)), null),
}));
type StatusWithoutAccount = Omit<v.InferOutput<typeof baseStatusSchema>, 'account'> & {
account: Account | null;
reblog: Status | null;
quote: Status | null;
}
type Status = v.InferOutput<typeof baseStatusSchema> & {
reblog: Status | null;
quote: Status | null;
}
export { statusSchema, statusWithoutAccountSchema, type Status };
export { statusSchema, statusWithoutAccountSchema, type Status, type StatusWithoutAccount };

View file

@ -25,7 +25,6 @@ const translationSchema = v.pipe(
if (translation?.text) return {
content: translation.text,
detected_source_language: translation.detected_language,
provider: '',
};
return translation;
@ -37,7 +36,7 @@ const translationSchema = v.pipe(
poll: v.fallback(v.optional(translationPollSchema), undefined),
media_attachments: filteredArray(translationMediaAttachment),
detected_source_language: v.string(),
provider: v.string(),
provider: v.fallback(v.nullable(v.string()), null),
}),
);

View file

@ -85,6 +85,12 @@ const AKKOMA = 'akkoma';
*/
const GLITCH = 'glitch';
/**
* glitch-soc, fork of Mastodon that provides local posting and a wider range of content types.
* @see {@link https://github.com/hometown-fork/hometown}
*/
const HOMETOWN = 'hometown';
/**
* Pl, fork of Pleroma developed by pl-api author.
* @see {@link https://github.com/mkljczk/pl}
@ -113,7 +119,7 @@ const getFeatures = (instance: Instance) => {
* @see PATCH /api/v1/accounts/update_credentials
*/
accountAvatarDescription: any([
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === PLEROMA && v.build === PL,
]),
@ -202,6 +208,7 @@ const getFeatures = (instance: Instance) => {
* @see {@link https://docs.joinmastodon.org/methods/announcements/}
*/
announcements: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PLEROMA,
@ -270,6 +277,7 @@ const getFeatures = (instance: Instance) => {
*/
bots: any([
v.software === GOTOSOCIAL,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PLEROMA,
]),
@ -302,7 +310,7 @@ const getFeatures = (instance: Instance) => {
conversations: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PIXELFED,
@ -397,6 +405,7 @@ const getFeatures = (instance: Instance) => {
* @see PUT /api/v1/statuses/:id
*/
editStatuses: any([
v.software === FIREFISH,
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === ICESHRIMP,
v.software === MASTODON,
@ -430,6 +439,7 @@ const getFeatures = (instance: Instance) => {
* @see POST /v1/statuses/:id/unreact/:emoji
*/
emojiReacts: any([
v.software === FIREFISH,
v.software === MITRA && gte(v.version, '2.21.0'),
v.software === PLEROMA,
instance ? instance.configuration.reactions.max_reactions > 0 : false,
@ -529,7 +539,7 @@ const getFeatures = (instance: Instance) => {
* @see POST /api/v1/tags/:name/unfollow
*/
followHashtags: any([
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === MASTODON && gte(v.compatVersion, '4.0.0'),
v.software === PLEROMA && v.build === AKKOMA,
v.software === PLEROMA && v.build === PL,
@ -541,6 +551,7 @@ const getFeatures = (instance: Instance) => {
* @see PATCH /api/v1/accounts/update_credentials
*/
followRequests: any([
v.software === FIREFISH,
v.software === GOTOSOCIAL,
v.software === MASTODON,
v.software === MITRA,
@ -553,7 +564,7 @@ const getFeatures = (instance: Instance) => {
* @see GET /api/v1/followed_tags
*/
followedHashtagsList: any([
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === MASTODON && gte(v.compatVersion, '4.1.0'),
v.software === PLEROMA && v.build === AKKOMA,
v.software === PLEROMA && v.build === PL,
@ -612,7 +623,7 @@ const getFeatures = (instance: Instance) => {
* @see POST /api/v1/import
*/
importBlocks: any([
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === PLEROMA,
]),
@ -623,7 +634,7 @@ const getFeatures = (instance: Instance) => {
*/
importFollows: any([
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
v.software === PLEROMA,
]),
@ -637,7 +648,7 @@ const getFeatures = (instance: Instance) => {
* Allow to specify mode of data import to either `merge` or `overwrite`.
* @see POST /api/v1/import
*/
importOverwrite: v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
importOverwrite: v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
/**
* View posts from specific instance.
@ -651,13 +662,14 @@ const getFeatures = (instance: Instance) => {
* @see {@link https://docs.joinmastodon.org/methods/instance/#v2}
*/
instanceV2: any([
v.software === FIREFISH,
v.software === GOTOSOCIAL,
v.software === MASTODON && gte(v.compatVersion, '4.0.0'),
v.software === PLEROMA && v.build === REBASED && gte(v.version, '2.6.0'),
v.software === PLEROMA && gte(v.version, '2.7.0'),
]),
interactionRequests: v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
interactionRequests: v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
/**
* Server-side status language detection.
@ -688,7 +700,10 @@ const getFeatures = (instance: Instance) => {
* Ability to post statuses that don't federate.
* @see POST /api/v1/statuses
*/
localOnlyStatuses: federation && v.software === GOTOSOCIAL,
localOnlyStatuses: federation && any([
v.software === GOTOSOCIAL,
v.software === MASTODON && v.build === HOMETOWN,
]),
/**
* Can sign in using username instead of e-mail address.
@ -745,6 +760,7 @@ const getFeatures = (instance: Instance) => {
* @see POST /api/v2/media
*/
mediaV2: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === MITRA,
@ -822,6 +838,7 @@ const getFeatures = (instance: Instance) => {
* @see GET /api/v1/notifications
*/
notificationsIncludeTypes: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PLEROMA && gte(v.version, '2.5.0'),
@ -919,6 +936,7 @@ const getFeatures = (instance: Instance) => {
* @see PATCH /api/v1/accounts/update_credentials
*/
profileFields: any([
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PLEROMA,
v.software === TAKAHE && gte(v.version, '0.7.0'),
@ -1018,6 +1036,7 @@ const getFeatures = (instance: Instance) => {
* @see {@link https://docs.joinmastodon.org/methods/scheduled_statuses/}
*/
scheduledStatuses: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === MASTODON,
v.software === PLEROMA,
@ -1140,6 +1159,7 @@ const getFeatures = (instance: Instance) => {
*/
trendingStatuses: any([
v.software === DITTO,
v.software === FIREFISH,
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === ICESHRIMP,
v.software === MASTODON,
@ -1151,6 +1171,7 @@ const getFeatures = (instance: Instance) => {
*/
trends: any([
v.software === DITTO,
v.software === FIREFISH,
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === ICESHRIMP,
v.software === MASTODON,
@ -1205,7 +1226,7 @@ const parseVersion = (version: string): Backend => {
const compat = match ? semverParse(match[1]) || semverCoerce(match[1]) : null;
if (match && semver && compat) {
return {
build: semver.build[0],
build: semver.build[0]?.split('-')[0],
compatVersion: compat.version,
software: match[2] || MASTODON,
version: semver.version.split('-')[0],

View file

@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "0.1.3",
"version": "0.1.4",
"type": "module",
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
"repository": {

View file

@ -35,6 +35,8 @@ Changes made since the project forked from Soapbox in April 2024.
- You can browse Bubble timeline, if supported by backend.
- Mastodon displays trending articles on Search page.
- Posts can be addressed to lists of users, on Pleroma.
- Support for events with external registration.
- Added a dedicated wrench reaction button.
### Changed
@ -67,6 +69,7 @@ Changes made since the project forked from Soapbox in April 2024.
**Internal:**
- Migrated some local stores from Redux to Zustand.
- Posts are now emojified during render, instead of when inserting posts to the state.
**Dependencies:**
- `@tanstack/react-virtual` is used for list virtualization, instead of `react-virtuoso`. This improves compatibility with Ladybird browser.

BIN
packages/pl-fe/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -102,7 +102,7 @@
"mini-css-extract-plugin": "^2.9.1",
"multiselect-react-dropdown": "^2.0.25",
"path-browserify": "^1.0.1",
"pl-api": "^0.1.3",
"pl-api": "^0.1.4",
"postcss": "^8.4.47",
"process": "^0.11.10",
"punycode": "^2.1.1",

View file

@ -90,7 +90,6 @@ type BookmarksAction =
ReturnType<typeof fetchBookmarkedStatusesRequest>
| ReturnType<typeof fetchBookmarkedStatusesSuccess>
| ReturnType<typeof fetchBookmarkedStatusesFail>
| ReturnType<typeof expandBookmarkedStatuses>
| ReturnType<typeof expandBookmarkedStatusesRequest>
| ReturnType<typeof expandBookmarkedStatusesSuccess>
| ReturnType<typeof expandBookmarkedStatusesFail>;

View file

@ -6,11 +6,9 @@ import { normalizeGroup } from 'pl-fe/normalizers/group';
import type { Account as BaseAccount, Group, Poll, Status as BaseStatus } from 'pl-api';
import type { AppDispatch } from 'pl-fe/store';
const STATUS_IMPORT = 'STATUS_IMPORT';
const STATUSES_IMPORT = 'STATUSES_IMPORT';
const POLLS_IMPORT = 'POLLS_IMPORT';
const importAccount = (data: BaseAccount) => importAccounts([data]);
const STATUS_IMPORT = 'STATUS_IMPORT' as const;
const STATUSES_IMPORT = 'STATUSES_IMPORT' as const;
const POLLS_IMPORT = 'POLLS_IMPORT' as const;
const importAccounts = (data: Array<BaseAccount>) => (dispatch: AppDispatch) => {
try {
@ -153,20 +151,19 @@ const importFetchedPoll = (poll: Poll) =>
dispatch(importPolls([poll]));
};
type ImporterAction =
| ReturnType<typeof importStatus>
| ReturnType<typeof importStatuses>
| ReturnType<typeof importPolls>;
export {
STATUS_IMPORT,
STATUSES_IMPORT,
POLLS_IMPORT,
importAccount,
importAccounts,
importGroup,
importGroups,
importStatus,
importStatuses,
importPolls,
importFetchedAccount,
importFetchedAccounts,
importFetchedStatus,
importFetchedStatuses,
importFetchedPoll,
type ImporterAction,
};

View file

@ -1,17 +0,0 @@
import { useModalsStore } from 'pl-fe/stores/modals';
import type { ModalType } from 'pl-fe/features/ui/components/modal-root';
import type { OpenModalProps } from 'pl-fe/stores/modals';
const openModal = (...props: OpenModalProps) => () => {
useModalsStore.getState().openModal(...props);
};
const closeModal = (type?: ModalType) => () => {
useModalsStore.getState().closeModal(type);
};
export {
openModal,
closeModal,
};

View file

@ -68,7 +68,6 @@ export {
PLEROMA_PRELOAD_IMPORT,
MASTODON_PRELOAD_IMPORT,
preload,
preloadPleroma,
preloadMastodon,
type PreloadAction,
};

View file

@ -1,25 +1,6 @@
import { register, saveSettings } from './registerer';
import {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
setAlerts,
} from './setter';
import type { AppDispatch } from 'pl-fe/store';
const changeAlerts = (path: Array<string>, value: any) =>
(dispatch: AppDispatch) => {
dispatch(setAlerts(path, value));
dispatch(saveSettings() as any);
};
export { register } from './registerer';
export {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
register,
changeAlerts,
};
} from './setter';

View file

@ -3,7 +3,6 @@ import type { WebPushSubscription } from 'pl-api';
const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const;
const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const;
const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_SUBSCRIPTION' as const;
const SET_ALERTS = 'PUSH_NOTIFICATIONS_SET_ALERTS' as const;
const setBrowserSupport = (value: boolean) => ({
type: SET_BROWSER_SUPPORT,
@ -19,26 +18,17 @@ const clearSubscription = () => ({
type: CLEAR_SUBSCRIPTION,
});
const setAlerts = (path: Array<string>, value: any) => ({
type: SET_ALERTS,
path,
value,
});
type SetterAction =
| ReturnType<typeof setBrowserSupport>
| ReturnType<typeof setSubscription>
| ReturnType<typeof clearSubscription>
| ReturnType<typeof setAlerts>;
| ReturnType<typeof clearSubscription>;
export {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
setBrowserSupport,
setSubscription,
clearSubscription,
setAlerts,
type SetterAction,
};

View file

@ -7,21 +7,11 @@ const createPushSubscription = (params: CreatePushNotificationsSubscriptionParam
(dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState).pushNotifications.createSubscription(params);
const fetchPushSubscription = () =>
(dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState).pushNotifications.getSubscription();
const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) =>
(dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState).pushNotifications.updateSubscription(params);
const deletePushSubscription = () =>
(dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState).pushNotifications.deleteSubscription();
export {
createPushSubscription,
fetchPushSubscription,
updatePushSubscription,
deletePushSubscription,
};

View file

@ -273,14 +273,6 @@ const expandStatusSpoiler = (statusIds: string[] | string) => {
};
};
const toggleStatusSpoilerExpanded = (status: Pick<Status, 'id' | 'expanded'>) => {
if (status.expanded) {
return collapseStatusSpoiler(status.id);
} else {
return expandStatusSpoiler(status.id);
}
};
let TRANSLATIONS_QUEUE: Set<string> = new Set();
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
@ -414,7 +406,6 @@ export {
toggleStatusMediaHidden,
expandStatusSpoiler,
collapseStatusSpoiler,
toggleStatusSpoilerExpanded,
translateStatus,
undoStatusTranslation,
unfilterStatus,

View file

@ -1,11 +1,11 @@
import { useInfiniteQuery } from '@tanstack/react-query';
import { Entities } from 'pl-fe/entity-store/entities';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
import { flattenPages } from 'pl-fe/utils/queries';
import { useRelationships } from './useRelationships';
import { useRelationships } from './use-relationships';
import type { PaginatedResponse, Account as BaseAccount } from 'pl-api';
import type { EntityFn } from 'pl-fe/entity-store/hooks/types';
@ -72,7 +72,6 @@ const useFollowers = (accountId: string | undefined) => {
};
export {
useAccountList,
useBlocks,
useMutes,
useFollowing,

View file

@ -2,14 +2,14 @@ import { useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import { Entities } from 'pl-fe/entity-store/entities';
import { useEntityLookup } from 'pl-fe/entity-store/hooks/useEntityLookup';
import { useClient } from 'pl-fe/hooks/useClient';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useEntityLookup } from 'pl-fe/entity-store/hooks/use-entity-lookup';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
import { useAccountScrobble } from './useAccountScrobble';
import { useRelationship } from './useRelationship';
import { useAccountScrobble } from './use-account-scrobble';
import { useRelationship } from './use-relationship';
import type { Account as BaseAccount } from 'pl-api';

View file

@ -1,7 +1,7 @@
import { useQuery } from '@tanstack/react-query';
import { useClient } from 'pl-fe/hooks/useClient';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import type { Scrobble } from 'pl-api';

View file

@ -2,15 +2,15 @@ import { useEffect, useMemo } from 'react';
import { useHistory } from 'react-router-dom';
import { Entities } from 'pl-fe/entity-store/entities';
import { useEntity } from 'pl-fe/entity-store/hooks/useEntity';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useClient } from 'pl-fe/hooks/useClient';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
import { useAccountScrobble } from './useAccountScrobble';
import { useRelationship } from './useRelationship';
import { useAccountScrobble } from './use-account-scrobble';
import { useRelationship } from './use-relationship';
import type { Account as BaseAccount } from 'pl-api';
@ -32,7 +32,7 @@ const useAccount = (accountId?: string, opts: UseAccountOpts = {}) => {
{ enabled: !!accountId, transform: normalizeAccount },
);
const meta = useAppSelector((state) => accountId && state.accounts_meta[accountId] || {});
const meta = useAppSelector((state) => accountId && state.accounts_meta[accountId]);
const {
relationship,

View file

@ -1,9 +1,9 @@
import { importEntities } from 'pl-fe/entity-store/actions';
import { Entities } from 'pl-fe/entity-store/entities';
import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useClient } from 'pl-fe/hooks/useClient';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useClient } from 'pl-fe/hooks/use-client';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
interface FollowOpts {
reblogs?: boolean;

View file

@ -1,9 +1,9 @@
import * as v from 'valibot';
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 { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import type { Relationship } from 'pl-api';

View file

@ -1,7 +1,7 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/useBatchedEntities';
import { useClient } from 'pl-fe/hooks/useClient';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/use-batched-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import type { Relationship } from 'pl-api';

View file

@ -7,10 +7,10 @@ import {
} from 'pl-api';
import * as v from 'valibot';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { queryClient } from 'pl-fe/queries/client';
import { useAnnouncements as useUserAnnouncements } from '../announcements/useAnnouncements';
import { useAnnouncements as useUserAnnouncements } from '../announcements/use-announcements';
const useAnnouncements = () => {
const client = useClient();

View file

@ -1,6 +1,6 @@
import { useMutation, useQuery } from '@tanstack/react-query';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { queryClient } from 'pl-fe/queries/client';
import type { AdminDomain } from 'pl-api';

View file

@ -1,7 +1,7 @@
import { useInfiniteQuery } from '@tanstack/react-query';
import { PaginatedResponse } from 'pl-api';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { flattenPages } from 'pl-fe/utils/queries';
import type { AdminModerationLogEntry } from 'pl-api';

View file

@ -1,6 +1,6 @@
import { useMutation, useQuery } from '@tanstack/react-query';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { queryClient } from 'pl-fe/queries/client';
import type { AdminRelay } from 'pl-api';

View file

@ -1,6 +1,6 @@
import { useMutation, useQuery } from '@tanstack/react-query';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { queryClient } from 'pl-fe/queries/client';
import type { AdminRule } from 'pl-api';

View file

@ -1,6 +1,6 @@
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 { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
import { useClient } from 'pl-fe/hooks/use-client';
import type { Account } from 'pl-fe/normalizers/account';

View file

@ -1,5 +1,5 @@
import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction';
import { useClient } from 'pl-fe/hooks/useClient';
import { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
import { useClient } from 'pl-fe/hooks/use-client';
import type { EntityCallbacks } from 'pl-fe/entity-store/hooks/types';
import type { Account } from 'pl-fe/normalizers/account';

View file

@ -2,7 +2,7 @@ import { useMutation, useQuery } from '@tanstack/react-query';
import { announcementReactionSchema, type AnnouncementReaction, type Announcement } from 'pl-api';
import * as v from 'valibot';
import { useClient } from 'pl-fe/hooks/useClient';
import { useClient } from 'pl-fe/hooks/use-client';
import { queryClient } from 'pl-fe/queries/client';
const updateReaction = (reaction: AnnouncementReaction, count: number, me?: boolean, overwrite?: boolean) => v.parse(announcementReactionSchema, {

View file

@ -1,6 +1,6 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import type { Group } from 'pl-api';
import type { Account } from 'pl-fe/normalizers/account';

View file

@ -1,6 +1,6 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
import type { Group as BaseGroup, CreateGroupParams } from 'pl-api';

View file

@ -1,6 +1,6 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
import { useClient } from 'pl-fe/hooks/useClient';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import type { Group } from 'pl-api';

View file

@ -1,6 +1,6 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
import { useClient } from 'pl-fe/hooks/useClient';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
import { useClient } from 'pl-fe/hooks/use-client';
const useDeleteGroup = () => {
const client = useClient();

View file

@ -1,8 +1,8 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
import type { Group, GroupMember as GroupMember, GroupRole } from 'pl-api';

View file

@ -2,7 +2,7 @@ import { __stub } from 'pl-fe/api';
import { buildStatus } from 'pl-fe/jest/factory';
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
import { useGroupMedia } from './useGroupMedia';
import { useGroupMedia } from './use-group-media';
const status = buildStatus();
const groupId = '1';

View file

@ -1,6 +1,6 @@
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 { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeStatus } from 'pl-fe/normalizers/status';
const useGroupMedia = (groupId: string) => {

View file

@ -4,7 +4,7 @@ import { __stub } from 'pl-fe/api';
import { buildGroupMember } from 'pl-fe/jest/factory';
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
import { useGroupMembers } from './useGroupMembers';
import { useGroupMembers } from './use-group-members';
const groupMember = buildGroupMember();
const groupId = '1';

View file

@ -1,6 +1,6 @@
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 { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroupMember, type GroupMember } from 'pl-fe/normalizers/group-member';
import type { GroupMember as BaseGroupMember, GroupRoles } from 'pl-api';

View file

@ -1,12 +1,12 @@
import { GroupRoles } from 'pl-api';
import { Entities } from 'pl-fe/entity-store/entities';
import { useDismissEntity } from 'pl-fe/entity-store/hooks/useDismissEntity';
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
import { useClient } from 'pl-fe/hooks/useClient';
import { useDismissEntity } from 'pl-fe/entity-store/hooks/use-dismiss-entity';
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeAccount } from 'pl-fe/normalizers/account';
import { useGroupRelationship } from './useGroupRelationship';
import { useGroupRelationship } from './use-group-relationship';
import type { ExpandedEntitiesPath } from 'pl-fe/entity-store/hooks/types';

View file

@ -1,8 +1,8 @@
import * as v from 'valibot';
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 { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import type { GroupRelationship } from 'pl-api';

View file

@ -1,7 +1,7 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/useBatchedEntities';
import { useClient } from 'pl-fe/hooks/useClient';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/use-batched-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import type { GroupRelationship } from 'pl-api';

View file

@ -2,7 +2,7 @@ import { __stub } from 'pl-fe/api';
import { buildGroup } from 'pl-fe/jest/factory';
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
import { useGroup } from './useGroup';
import { useGroup } from './use-group';
const group = buildGroup({ id: '1', display_name: 'soapbox' });

View file

@ -2,11 +2,11 @@ import { useEffect } from 'react';
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 { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
import { useGroupRelationship } from './useGroupRelationship';
import { useGroupRelationship } from './use-group-relationship';
import type { Group as BaseGroup } from 'pl-api';

View file

@ -5,7 +5,7 @@ import { __stub } from 'pl-fe/api';
import { buildGroup } from 'pl-fe/jest/factory';
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
import { useGroups } from './useGroups';
import { useGroups } from './use-groups';
const group = buildGroup({ id: '1', display_name: 'soapbox' });
const store = {

View file

@ -1,10 +1,10 @@
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 { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
import { useGroupRelationships } from './useGroupRelationships';
import { useGroupRelationships } from './use-group-relationships';
import type { Group as BaseGroup } from 'pl-api';

View file

@ -1,8 +1,8 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { useGroups } from './useGroups';
import { useGroups } from './use-groups';
import type { Group } from 'pl-api';

View file

@ -1,8 +1,8 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { useGroups } from './useGroups';
import { useGroups } from './use-groups';
import type { Group } from 'pl-api';

View file

@ -1,8 +1,8 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
import type { Group, GroupMember, GroupRole } from 'pl-api';

View file

@ -1,6 +1,6 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
import { normalizeGroup } from 'pl-fe/normalizers/group';
interface UpdateGroupParams {

View file

@ -1,9 +1,9 @@
import { useQuery } from '@tanstack/react-query';
import { useClient } from 'pl-fe/hooks/useClient';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useInstance } from 'pl-fe/hooks/useInstance';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useInstance } from 'pl-fe/hooks/use-instance';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
const useTranslationLanguages = () => {
const client = useClient();

View file

@ -2,9 +2,9 @@ import { useMutation, useQuery } from '@tanstack/react-query';
import { type InteractionPolicies, interactionPoliciesSchema } from 'pl-api';
import * as v from 'valibot';
import { useClient } from 'pl-fe/hooks/useClient';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import { queryClient } from 'pl-fe/queries/client';
const emptySchema = v.parse(interactionPoliciesSchema, {});

View file

@ -1,8 +1,8 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { selectEntity } from 'pl-fe/entity-store/selectors';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useBookmarkFolders } from './useBookmarkFolders';
import { useBookmarkFolders } from './use-bookmark-folders';
import type{ BookmarkFolder } from 'pl-api';

View file

@ -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 { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import type { BookmarkFolder } from 'pl-api';

View file

@ -1,6 +1,6 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
interface CreateBookmarkFolderParams {
name: string;

View file

@ -1,6 +1,6 @@
import { Entities } from 'pl-fe/entity-store/entities';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
import { useClient } from 'pl-fe/hooks/useClient';
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
import { useClient } from 'pl-fe/hooks/use-client';
const useDeleteBookmarkFolder = () => {
const client = useClient();

View file

@ -1,6 +1,6 @@
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 { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
import { useClient } from 'pl-fe/hooks/use-client';
interface UpdateBookmarkFolderParams {
name: string;

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
interface UseCommunityStreamOpts {
onlyMedia?: boolean;

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
const useDirectStream = () => useTimelineStream('direct');

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId } as any);

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
const useHashtagStream = (tag: string) => useTimelineStream('hashtag', { tag });

View file

@ -1,6 +1,6 @@
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
const useListStream = (listId: string) => {
const { isLoggedIn } = useLoggedIn();

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
interface UsePublicStreamOpts {
onlyMedia?: boolean;

View file

@ -1,4 +1,4 @@
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
interface UseRemoteStreamOpts {
instance: string;

View file

@ -1,8 +1,8 @@
import { useEffect, useRef } from 'react';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useClient } from 'pl-fe/hooks/useClient';
import { useInstance } from 'pl-fe/hooks/useInstance';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useClient } from 'pl-fe/hooks/use-client';
import { useInstance } from 'pl-fe/hooks/use-instance';
import { getAccessToken } from 'pl-fe/utils/auth';
import type { StreamingEvent } from 'pl-api';

View file

@ -11,17 +11,17 @@ import { useStatContext } from 'pl-fe/contexts/stat-context';
import { importEntities } from 'pl-fe/entity-store/actions';
import { Entities } from 'pl-fe/entity-store/entities';
import { selectEntity } from 'pl-fe/entity-store/selectors';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
import messages from 'pl-fe/messages';
import { queryClient } from 'pl-fe/queries/client';
import { useSettingsStore } from 'pl-fe/stores/settings';
import { getUnreadChatsCount, updateChatListItem } from 'pl-fe/utils/chats';
import { play, soundCache } from 'pl-fe/utils/sounds';
import { updateReactions } from '../announcements/useAnnouncements';
import { updateReactions } from '../announcements/use-announcements';
import { useTimelineStream } from './useTimelineStream';
import { useTimelineStream } from './use-timeline-stream';
import type { Announcement, AnnouncementReaction, FollowRelationshipUpdate, Relationship, StreamingEvent } from 'pl-api';
import type { AppDispatch, RootState } from 'pl-fe/store';

View file

@ -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 { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
import { useClient } from 'pl-fe/hooks/use-client';
import { useFeatures } from 'pl-fe/hooks/use-features';
import type { TrendsLink } from 'pl-api';

View file

@ -1,15 +0,0 @@
import React from 'react';
interface IInlineSVG {
loader?: JSX.Element;
}
const InlineSVG: React.FC<IInlineSVG> = ({ loader }): JSX.Element => {
if (loader) {
return loader;
} else {
throw 'You used react-inlinesvg without a loader! This will cause jumpy loading during render.';
}
};
export { InlineSVG as default };

View file

@ -5,7 +5,7 @@ import { useIntl, FormattedMessage } from 'react-intl';
import { useHistory } from 'react-router-dom';
import { fetchRelationships } from 'pl-fe/actions/accounts';
import { useAccount } from 'pl-fe/api/hooks/accounts/useAccount';
import { useAccount } from 'pl-fe/api/hooks/accounts/use-account';
import Badge from 'pl-fe/components/badge';
import Card, { CardBody } from 'pl-fe/components/ui/card';
import HStack from 'pl-fe/components/ui/hstack';
@ -14,8 +14,8 @@ import Stack from 'pl-fe/components/ui/stack';
import Text from 'pl-fe/components/ui/text';
import ActionButton from 'pl-fe/features/ui/components/action-button';
import { UserPanel } from 'pl-fe/features/ui/util/async-components';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';
import { showAccountHoverCard } from './hover-account-wrapper';

View file

@ -13,7 +13,7 @@ import Text from 'pl-fe/components/ui/text';
import VerificationBadge from 'pl-fe/components/verification-badge';
import Emojify from 'pl-fe/features/emoji/emojify';
import ActionButton from 'pl-fe/features/ui/components/action-button';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { getAcct } from 'pl-fe/utils/accounts';
import { displayFqn } from 'pl-fe/utils/state';

View file

@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useIntl, type IntlShape } from 'react-intl';
import { TransitionMotion, spring } from 'react-motion';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { useSettings } from 'pl-fe/hooks/use-settings';
import { isNumber, roundDown } from 'pl-fe/utils/numbers';
const obfuscatedCount = (count: number): string => {

View file

@ -3,7 +3,7 @@ import { FormattedDate } from 'react-intl';
import Stack from 'pl-fe/components/ui/stack';
import Text from 'pl-fe/components/ui/text';
import { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { getTextDirection } from 'pl-fe/utils/rtl';
import AnnouncementContent from './announcement-content';

View file

@ -5,11 +5,11 @@ import { FormattedMessage } from 'react-intl';
import ReactSwipeableViews from 'react-swipeable-views';
import { createSelector } from 'reselect';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/useAnnouncements';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements';
import Card from 'pl-fe/components/ui/card';
import HStack from 'pl-fe/components/ui/hstack';
import Widget from 'pl-fe/components/ui/widget';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import Announcement from './announcement';

View file

@ -1,7 +1,7 @@
import React from 'react';
import unicodeMapping from 'pl-fe/features/emoji/mapping';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { useSettings } from 'pl-fe/hooks/use-settings';
import { joinPublicPath } from 'pl-fe/utils/static';
import type { Map as ImmutableMap } from 'immutable';

View file

@ -1,7 +1,7 @@
import clsx from 'clsx';
import React, { useState } from 'react';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/useAnnouncements';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements';
import AnimatedNumber from 'pl-fe/components/animated-number';
import unicodeMapping from 'pl-fe/features/emoji/mapping';

View file

@ -2,9 +2,9 @@ import clsx from 'clsx';
import React from 'react';
import { TransitionMotion, spring } from 'react-motion';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/useAnnouncements';
import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements';
import EmojiPickerDropdown from 'pl-fe/features/emoji/containers/emoji-picker-dropdown-container';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { useSettings } from 'pl-fe/hooks/use-settings';
import Reaction from './reaction';

View file

@ -1,7 +1,7 @@
import React, { Suspense } from 'react';
import { MediaGallery } from 'pl-fe/features/ui/util/async-components';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { useSettings } from 'pl-fe/hooks/use-settings';
import { useModalsStore } from 'pl-fe/stores/modals';
import { isMediaVisible } from './statuses/sensitive-content-overlay';

View file

@ -4,7 +4,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react';
import { accountSearch } from 'pl-fe/actions/accounts';
import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import type { Menu } from 'pl-fe/components/dropdown-menu';
import type { InputThemes } from 'pl-fe/components/ui/input';

View file

@ -4,7 +4,7 @@ import HStack from 'pl-fe/components/ui/hstack';
import Icon from 'pl-fe/components/ui/icon';
import Stack from 'pl-fe/components/ui/stack';
import Text from 'pl-fe/components/ui/text';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
const buildingCommunityIcon = require('@tabler/icons/outline/building-community.svg');
const homeIcon = require('@tabler/icons/outline/home-2.svg');

View file

@ -4,7 +4,7 @@ import React from 'react';
import Avatar from 'pl-fe/components/ui/avatar';
import HStack from 'pl-fe/components/ui/hstack';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { makeGetAccount } from 'pl-fe/selectors';
import type { Account } from 'pl-fe/normalizers/account';

View file

@ -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 { useFeatures } from 'pl-fe/hooks/useFeatures';
import { useInstance } from 'pl-fe/hooks/useInstance';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useInstance } from 'pl-fe/hooks/use-instance';
const messages = defineMessages({
birthdayPlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birthday' },

View file

@ -5,8 +5,8 @@ import { FormattedMessage } from 'react-intl';
import { fetchBirthdayReminders } from 'pl-fe/actions/accounts';
import Widget from 'pl-fe/components/ui/widget';
import AccountContainer from 'pl-fe/containers/account-container';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
const timeToMidnight = () => {
const now = new Date();

View file

@ -5,7 +5,7 @@ import { unblockDomain } from 'pl-fe/actions/domain-blocks';
import HStack from 'pl-fe/components/ui/hstack';
import IconButton from 'pl-fe/components/ui/icon-button';
import Text from 'pl-fe/components/ui/text';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
const messages = defineMessages({
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },

View file

@ -11,7 +11,7 @@ import VerificationBadge from 'pl-fe/components/verification-badge';
import Emojify from 'pl-fe/features/emoji/emojify';
import EventActionButton from 'pl-fe/features/event/components/event-action-button';
import EventDate from 'pl-fe/features/event/components/event-date';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import type { Status as StatusEntity } from 'pl-fe/normalizers/status';

View file

@ -31,4 +31,4 @@ const ForkAwesomeIcon: React.FC<IForkAwesomeIcon> = ({ id, className, fixedWidth
);
};
export { type IForkAwesomeIcon, ForkAwesomeIcon as default };
export { ForkAwesomeIcon as default };

View file

@ -7,8 +7,8 @@ import Button from 'pl-fe/components/ui/button';
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 { useInstance } from 'pl-fe/hooks/useInstance';
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
import { useInstance } from 'pl-fe/hooks/use-instance';
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
const acceptedGdpr = !!localStorage.getItem('plfe:gdpr');

View file

@ -1,9 +1,9 @@
import React from 'react';
import { Helmet as ReactHelmet } from 'react-helmet-async';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useInstance } from 'pl-fe/hooks/useInstance';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useInstance } from 'pl-fe/hooks/use-instance';
import { useSettings } from 'pl-fe/hooks/use-settings';
import { RootState } from 'pl-fe/store';
import FaviconService from 'pl-fe/utils/favicon-service';

View file

@ -3,7 +3,7 @@ import debounce from 'lodash/debounce';
import React, { useRef } from 'react';
import { fetchAccount } from 'pl-fe/actions/accounts';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { isMobile } from 'pl-fe/is-mobile';
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';

View file

@ -7,7 +7,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { locationSearch } from 'pl-fe/actions/events';
import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input';
import Icon from 'pl-fe/components/icon';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import AutosuggestLocation from './autosuggest-location';

View file

@ -5,8 +5,8 @@ import Blurhash from 'pl-fe/components/blurhash';
import Icon from 'pl-fe/components/icon';
import StillImage from 'pl-fe/components/still-image';
import { MIMETYPE_ICONS } from 'pl-fe/components/upload';
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
import { useSettings } from 'pl-fe/hooks/use-settings';
import { truncateFilename } from 'pl-fe/utils/media';
import { isIOS } from '../is-mobile';
@ -564,7 +564,4 @@ const MediaGallery: React.FC<IMediaGallery> = (props) => {
);
};
export {
type IMediaGallery,
MediaGallery as default,
};
export { MediaGallery as default };

View file

@ -5,8 +5,8 @@ import { useHistory } from 'react-router-dom';
import { cancelReplyCompose } from 'pl-fe/actions/compose';
import { saveDraftStatus } from 'pl-fe/actions/draft-statuses';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { usePrevious } from 'pl-fe/hooks/usePrevious';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { usePrevious } from 'pl-fe/hooks/use-previous';
import { useModalsStore } from 'pl-fe/stores/modals';
import type { ModalType } from 'pl-fe/features/ui/components/modal-root';

View file

@ -2,8 +2,8 @@ import React from 'react';
import { Link } from 'react-router-dom';
import Text from 'pl-fe/components/ui/text';
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
import { useSettings } from 'pl-fe/hooks/useSettings';
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
import { useSettings } from 'pl-fe/hooks/use-settings';
interface INavlinks {
type: string;

View file

@ -107,9 +107,9 @@ const ParsedContent: React.FC<IParsedContent> = (({ html, mentions, hasQuote, em
}
},
transform(reactNode) {
transform(reactNode, _domNode, index) {
if (typeof reactNode === 'string') {
return <Emojify text={reactNode} emojis={emojiMap} />;
return <Emojify key={index} text={reactNode} emojis={emojiMap} />;
}
return reactNode as JSX.Element;

View file

@ -7,7 +7,7 @@ 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 Tooltip from 'pl-fe/components/ui/tooltip';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import RelativeTimestamp from '../relative-timestamp';

View file

@ -4,8 +4,8 @@ import { defineMessages, useIntl } from 'react-intl';
import { vote } from 'pl-fe/actions/polls';
import Stack from 'pl-fe/components/ui/stack';
import Text from 'pl-fe/components/ui/text';
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useModalsStore } from 'pl-fe/stores/modals';
import PollFooter from './poll-footer';

Some files were not shown because too many files have changed in this diff Show more