Compare commits
89 commits
907063c97a
...
403829da24
Author | SHA1 | Date | |
---|---|---|---|
403829da24 | |||
52548c8403 | |||
2963504736 | |||
d4f930132e | |||
0a253894a6 | |||
d3b5078030 | |||
e546d787f0 | |||
492a4214a5 | |||
618f5f5f25 | |||
444f9126d2 | |||
d4dc7e9e9c | |||
f08adfad9a | |||
ca76902f8b | |||
41a9c4183e | |||
d6aa4bf388 | |||
39f975c793 | |||
dc7939dea5 | |||
4340311c94 | |||
b3db562a32 | |||
60a7865420 | |||
86cb31918d | |||
e28d6d0223 | |||
22d5f1d9d9 | |||
73c1686c77 | |||
8e7be4467a | |||
9fef1d1f4e | |||
f2d9217f39 | |||
4012a27618 | |||
|
0fec37521e | ||
|
1bc46d3f6e | ||
a0c0f17004 | |||
7575de54bd | |||
459904bbf0 | |||
9cb5e96d3b | |||
e1165f23a0 | |||
392026bc39 | |||
966381a360 | |||
e88b10599f | |||
04d0b812f0 | |||
11a27f9504 | |||
e583d15d0d | |||
26adc7c29c | |||
d76a7e974b | |||
0d2347117f | |||
2fb53d92be | |||
558f89ee10 | |||
dd560efc6c | |||
7cc83b3744 | |||
fb34a8bf4a | |||
a4b520a13a | |||
9aa8ded6c6 | |||
3a00f0cea8 | |||
89deb6b9bd | |||
8a047d7c3a | |||
dc5fa13e64 | |||
2eab0b68b7 | |||
777c086fbe | |||
cb80ba3226 | |||
f592271b18 | |||
6d56513b9a | |||
9f709793a4 | |||
bd73697628 | |||
90c729ff71 | |||
3e34cb17d2 | |||
8dcddc9767 | |||
2ce2f96b16 | |||
eeb1e1370c | |||
cf9f9137b0 | |||
28fd9bfd61 | |||
bed3eadd2c | |||
ae3d98505e | |||
8b0863c6d8 | |||
f6d124241b | |||
3b745c6171 | |||
f2fba8e4db | |||
1db9b0f75c | |||
79c17473fe | |||
2a67433f6e | |||
6a232f204e | |||
881a03b24a | |||
a140baddf4 | |||
c740b19e30 | |||
c6be339ba0 | |||
14ecf62f4e | |||
ba0fb61374 | |||
9b17240f01 | |||
da23e85fd7 | |||
885bbe6c13 | |||
67d141b0e5 |
533 changed files with 5625 additions and 1968 deletions
41
.github/workflows/pl-hooks.yaml
vendored
Normal file
41
.github/workflows/pl-hooks.yaml
vendored
Normal 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
|
|
@ -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-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-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.
|
More projects to be announced.
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
"husky": "^9.0.0",
|
"husky": "^9.0.0",
|
||||||
"lint-staged": ">=10"
|
"lint-staged": ">=10"
|
||||||
},
|
},
|
||||||
"workspaces": ["pl-api", "pl-fe"],
|
"workspaces": ["pl-api", "pl-fe", "pl-hooks"],
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,7 @@ import { relationshipSchema } from './relationship';
|
||||||
import { roleSchema } from './role';
|
import { roleSchema } from './role';
|
||||||
import { coerceObject, datetimeSchema, filteredArray } from './utils';
|
import { coerceObject, datetimeSchema, filteredArray } from './utils';
|
||||||
|
|
||||||
const filterBadges = (tags?: string[]) =>
|
const getDomainFromURL = (account: Pick<Account, 'url'>): string => {
|
||||||
tags?.filter(tag => tag.startsWith('badge:')).map(tag => v.parse(roleSchema, { id: tag, name: tag.replace(/^badge:/, '') }));
|
|
||||||
|
|
||||||
const getDomainFromURL = (account: any): string => {
|
|
||||||
try {
|
try {
|
||||||
const url = account.url;
|
const url = account.url;
|
||||||
return new URL(url).host;
|
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 acct = account.acct;
|
||||||
const [user, domain] = acct.split('@');
|
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) => {
|
const preprocessAccount = v.transform((account: any) => {
|
||||||
if (!account?.acct) return null;
|
if (!account?.acct) return null;
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ const baseAccountSchema = v.object({
|
||||||
header_description: v.fallback(v.string(), ''),
|
header_description: v.fallback(v.string(), ''),
|
||||||
|
|
||||||
verified: v.fallback(v.optional(v.boolean()), undefined),
|
verified: v.fallback(v.optional(v.boolean()), undefined),
|
||||||
|
domain: v.fallback(v.string(), ''),
|
||||||
|
|
||||||
__meta: coerceObject({
|
__meta: coerceObject({
|
||||||
pleroma: v.fallback(v.any(), undefined),
|
pleroma: v.fallback(v.any(), undefined),
|
||||||
|
|
|
@ -4,8 +4,10 @@ import { coerceObject } from './utils';
|
||||||
|
|
||||||
const interactionPolicyEntrySchema = v.picklist(['public', 'followers', 'following', 'mutuals', 'mentioned', 'author', 'me']);
|
const interactionPolicyEntrySchema = v.picklist(['public', 'followers', 'following', 'mutuals', 'mentioned', 'author', 'me']);
|
||||||
|
|
||||||
|
type InteractionPolicyEntry = v.InferOutput<typeof interactionPolicyEntrySchema>;
|
||||||
|
|
||||||
const interactionPolicyRuleSchema = coerceObject({
|
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), []),
|
with_approval: v.fallback(v.array(interactionPolicyEntrySchema), []),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -27,5 +29,5 @@ const interactionPoliciesSchema = coerceObject({
|
||||||
|
|
||||||
type InteractionPolicies = v.InferOutput<typeof interactionPoliciesSchema>;
|
type InteractionPolicies = v.InferOutput<typeof interactionPoliciesSchema>;
|
||||||
|
|
||||||
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicy, type InteractionPolicies };
|
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicyEntry, type InteractionPolicy, type InteractionPolicies };
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import pick from 'lodash.pick';
|
import pick from 'lodash.pick';
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { accountSchema } from './account';
|
import { type Account, accountSchema } from './account';
|
||||||
import { customEmojiSchema } from './custom-emoji';
|
import { customEmojiSchema } from './custom-emoji';
|
||||||
import { emojiReactionSchema } from './emoji-reaction';
|
import { emojiReactionSchema } from './emoji-reaction';
|
||||||
import { filterResultSchema } from './filter-result';
|
import { filterResultSchema } from './filter-result';
|
||||||
|
@ -19,7 +19,7 @@ const statusEventSchema = v.object({
|
||||||
name: v.fallback(v.string(), ''),
|
name: v.fallback(v.string(), ''),
|
||||||
start_time: v.fallback(v.nullable(datetimeSchema), null),
|
start_time: v.fallback(v.nullable(datetimeSchema), null),
|
||||||
end_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),
|
participants_count: v.fallback(v.number(), 0),
|
||||||
location: v.fallback(v.nullable(v.object({
|
location: v.fallback(v.nullable(v.object({
|
||||||
name: v.fallback(v.string(), ''),
|
name: v.fallback(v.string(), ''),
|
||||||
|
@ -41,7 +41,7 @@ const baseStatusSchema = v.object({
|
||||||
uri: v.fallback(v.pipe(v.string(), v.url()), ''),
|
uri: v.fallback(v.pipe(v.string(), v.url()), ''),
|
||||||
created_at: v.fallback(datetimeSchema, new Date().toISOString()),
|
created_at: v.fallback(datetimeSchema, new Date().toISOString()),
|
||||||
account: accountSchema,
|
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'),
|
visibility: v.fallback(v.string(), 'public'),
|
||||||
sensitive: v.pipe(v.unknown(), v.transform(Boolean)),
|
sensitive: v.pipe(v.unknown(), v.transform(Boolean)),
|
||||||
spoiler_text: v.fallback(v.string(), ''),
|
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),
|
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> & {
|
type Status = v.InferOutput<typeof baseStatusSchema> & {
|
||||||
reblog: Status | null;
|
reblog: Status | null;
|
||||||
quote: Status | null;
|
quote: Status | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { statusSchema, statusWithoutAccountSchema, type Status };
|
export { statusSchema, statusWithoutAccountSchema, type Status, type StatusWithoutAccount };
|
||||||
|
|
|
@ -25,7 +25,6 @@ const translationSchema = v.pipe(
|
||||||
if (translation?.text) return {
|
if (translation?.text) return {
|
||||||
content: translation.text,
|
content: translation.text,
|
||||||
detected_source_language: translation.detected_language,
|
detected_source_language: translation.detected_language,
|
||||||
provider: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return translation;
|
return translation;
|
||||||
|
@ -37,7 +36,7 @@ const translationSchema = v.pipe(
|
||||||
poll: v.fallback(v.optional(translationPollSchema), undefined),
|
poll: v.fallback(v.optional(translationPollSchema), undefined),
|
||||||
media_attachments: filteredArray(translationMediaAttachment),
|
media_attachments: filteredArray(translationMediaAttachment),
|
||||||
detected_source_language: v.string(),
|
detected_source_language: v.string(),
|
||||||
provider: v.string(),
|
provider: v.fallback(v.nullable(v.string()), null),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,12 @@ const AKKOMA = 'akkoma';
|
||||||
*/
|
*/
|
||||||
const GLITCH = 'glitch';
|
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.
|
* Pl, fork of Pleroma developed by pl-api author.
|
||||||
* @see {@link https://github.com/mkljczk/pl}
|
* @see {@link https://github.com/mkljczk/pl}
|
||||||
|
@ -113,7 +119,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see PATCH /api/v1/accounts/update_credentials
|
* @see PATCH /api/v1/accounts/update_credentials
|
||||||
*/
|
*/
|
||||||
accountAvatarDescription: any([
|
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,
|
v.software === PLEROMA && v.build === PL,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -202,6 +208,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see {@link https://docs.joinmastodon.org/methods/announcements/}
|
* @see {@link https://docs.joinmastodon.org/methods/announcements/}
|
||||||
*/
|
*/
|
||||||
announcements: any([
|
announcements: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
|
@ -270,6 +277,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
*/
|
*/
|
||||||
bots: any([
|
bots: any([
|
||||||
v.software === GOTOSOCIAL,
|
v.software === GOTOSOCIAL,
|
||||||
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
]),
|
]),
|
||||||
|
@ -302,7 +310,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
conversations: any([
|
conversations: any([
|
||||||
v.software === FIREFISH,
|
v.software === FIREFISH,
|
||||||
v.software === FRIENDICA,
|
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 === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PIXELFED,
|
v.software === PIXELFED,
|
||||||
|
@ -397,6 +405,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see PUT /api/v1/statuses/:id
|
* @see PUT /api/v1/statuses/:id
|
||||||
*/
|
*/
|
||||||
editStatuses: any([
|
editStatuses: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
|
@ -430,6 +439,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see POST /v1/statuses/:id/unreact/:emoji
|
* @see POST /v1/statuses/:id/unreact/:emoji
|
||||||
*/
|
*/
|
||||||
emojiReacts: any([
|
emojiReacts: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === MITRA && gte(v.version, '2.21.0'),
|
v.software === MITRA && gte(v.version, '2.21.0'),
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
instance ? instance.configuration.reactions.max_reactions > 0 : false,
|
instance ? instance.configuration.reactions.max_reactions > 0 : false,
|
||||||
|
@ -529,7 +539,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see POST /api/v1/tags/:name/unfollow
|
* @see POST /api/v1/tags/:name/unfollow
|
||||||
*/
|
*/
|
||||||
followHashtags: any([
|
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 === MASTODON && gte(v.compatVersion, '4.0.0'),
|
||||||
v.software === PLEROMA && v.build === AKKOMA,
|
v.software === PLEROMA && v.build === AKKOMA,
|
||||||
v.software === PLEROMA && v.build === PL,
|
v.software === PLEROMA && v.build === PL,
|
||||||
|
@ -541,6 +551,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see PATCH /api/v1/accounts/update_credentials
|
* @see PATCH /api/v1/accounts/update_credentials
|
||||||
*/
|
*/
|
||||||
followRequests: any([
|
followRequests: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === GOTOSOCIAL,
|
v.software === GOTOSOCIAL,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === MITRA,
|
v.software === MITRA,
|
||||||
|
@ -553,7 +564,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see GET /api/v1/followed_tags
|
* @see GET /api/v1/followed_tags
|
||||||
*/
|
*/
|
||||||
followedHashtagsList: any([
|
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 === MASTODON && gte(v.compatVersion, '4.1.0'),
|
||||||
v.software === PLEROMA && v.build === AKKOMA,
|
v.software === PLEROMA && v.build === AKKOMA,
|
||||||
v.software === PLEROMA && v.build === PL,
|
v.software === PLEROMA && v.build === PL,
|
||||||
|
@ -612,7 +623,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see POST /api/v1/import
|
* @see POST /api/v1/import
|
||||||
*/
|
*/
|
||||||
importBlocks: any([
|
importBlocks: any([
|
||||||
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
|
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -623,7 +634,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
|
|
||||||
*/
|
*/
|
||||||
importFollows: any([
|
importFollows: any([
|
||||||
v.software === GOTOSOCIAL && gte(v.version, '0.16.1'),
|
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -637,7 +648,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* Allow to specify mode of data import to either `merge` or `overwrite`.
|
* Allow to specify mode of data import to either `merge` or `overwrite`.
|
||||||
* @see POST /api/v1/import
|
* @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.
|
* View posts from specific instance.
|
||||||
|
@ -651,13 +662,14 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see {@link https://docs.joinmastodon.org/methods/instance/#v2}
|
* @see {@link https://docs.joinmastodon.org/methods/instance/#v2}
|
||||||
*/
|
*/
|
||||||
instanceV2: any([
|
instanceV2: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === GOTOSOCIAL,
|
v.software === GOTOSOCIAL,
|
||||||
v.software === MASTODON && gte(v.compatVersion, '4.0.0'),
|
v.software === MASTODON && gte(v.compatVersion, '4.0.0'),
|
||||||
v.software === PLEROMA && v.build === REBASED && gte(v.version, '2.6.0'),
|
v.software === PLEROMA && v.build === REBASED && gte(v.version, '2.6.0'),
|
||||||
v.software === PLEROMA && gte(v.version, '2.7.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.
|
* Server-side status language detection.
|
||||||
|
@ -688,7 +700,10 @@ const getFeatures = (instance: Instance) => {
|
||||||
* Ability to post statuses that don't federate.
|
* Ability to post statuses that don't federate.
|
||||||
* @see POST /api/v1/statuses
|
* @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.
|
* Can sign in using username instead of e-mail address.
|
||||||
|
@ -745,6 +760,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see POST /api/v2/media
|
* @see POST /api/v2/media
|
||||||
*/
|
*/
|
||||||
mediaV2: any([
|
mediaV2: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === MITRA,
|
v.software === MITRA,
|
||||||
|
@ -822,6 +838,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see GET /api/v1/notifications
|
* @see GET /api/v1/notifications
|
||||||
*/
|
*/
|
||||||
notificationsIncludeTypes: any([
|
notificationsIncludeTypes: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PLEROMA && gte(v.version, '2.5.0'),
|
v.software === PLEROMA && gte(v.version, '2.5.0'),
|
||||||
|
@ -919,6 +936,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
* @see PATCH /api/v1/accounts/update_credentials
|
* @see PATCH /api/v1/accounts/update_credentials
|
||||||
*/
|
*/
|
||||||
profileFields: any([
|
profileFields: any([
|
||||||
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
v.software === TAKAHE && gte(v.version, '0.7.0'),
|
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/}
|
* @see {@link https://docs.joinmastodon.org/methods/scheduled_statuses/}
|
||||||
*/
|
*/
|
||||||
scheduledStatuses: any([
|
scheduledStatuses: any([
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === FRIENDICA,
|
v.software === FRIENDICA,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
v.software === PLEROMA,
|
v.software === PLEROMA,
|
||||||
|
@ -1140,6 +1159,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
*/
|
*/
|
||||||
trendingStatuses: any([
|
trendingStatuses: any([
|
||||||
v.software === DITTO,
|
v.software === DITTO,
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
|
@ -1151,6 +1171,7 @@ const getFeatures = (instance: Instance) => {
|
||||||
*/
|
*/
|
||||||
trends: any([
|
trends: any([
|
||||||
v.software === DITTO,
|
v.software === DITTO,
|
||||||
|
v.software === FIREFISH,
|
||||||
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
|
||||||
v.software === ICESHRIMP,
|
v.software === ICESHRIMP,
|
||||||
v.software === MASTODON,
|
v.software === MASTODON,
|
||||||
|
@ -1205,7 +1226,7 @@ const parseVersion = (version: string): Backend => {
|
||||||
const compat = match ? semverParse(match[1]) || semverCoerce(match[1]) : null;
|
const compat = match ? semverParse(match[1]) || semverCoerce(match[1]) : null;
|
||||||
if (match && semver && compat) {
|
if (match && semver && compat) {
|
||||||
return {
|
return {
|
||||||
build: semver.build[0],
|
build: semver.build[0]?.split('-')[0],
|
||||||
compatVersion: compat.version,
|
compatVersion: compat.version,
|
||||||
software: match[2] || MASTODON,
|
software: match[2] || MASTODON,
|
||||||
version: semver.version.split('-')[0],
|
version: semver.version.split('-')[0],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pl-api",
|
"name": "pl-api",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
|
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -35,6 +35,8 @@ Changes made since the project forked from Soapbox in April 2024.
|
||||||
- You can browse Bubble timeline, if supported by backend.
|
- You can browse Bubble timeline, if supported by backend.
|
||||||
- Mastodon displays trending articles on Search page.
|
- Mastodon displays trending articles on Search page.
|
||||||
- Posts can be addressed to lists of users, on Pleroma.
|
- Posts can be addressed to lists of users, on Pleroma.
|
||||||
|
- Support for events with external registration.
|
||||||
|
- Added a dedicated wrench reaction button.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -67,6 +69,7 @@ Changes made since the project forked from Soapbox in April 2024.
|
||||||
|
|
||||||
**Internal:**
|
**Internal:**
|
||||||
- Migrated some local stores from Redux to Zustand.
|
- Migrated some local stores from Redux to Zustand.
|
||||||
|
- Posts are now emojified during render, instead of when inserting posts to the state.
|
||||||
|
|
||||||
**Dependencies:**
|
**Dependencies:**
|
||||||
- `@tanstack/react-virtual` is used for list virtualization, instead of `react-virtuoso`. This improves compatibility with Ladybird browser.
|
- `@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
BIN
packages/pl-fe/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
|
@ -102,7 +102,7 @@
|
||||||
"mini-css-extract-plugin": "^2.9.1",
|
"mini-css-extract-plugin": "^2.9.1",
|
||||||
"multiselect-react-dropdown": "^2.0.25",
|
"multiselect-react-dropdown": "^2.0.25",
|
||||||
"path-browserify": "^1.0.1",
|
"path-browserify": "^1.0.1",
|
||||||
"pl-api": "^0.1.3",
|
"pl-api": "^0.1.4",
|
||||||
"postcss": "^8.4.47",
|
"postcss": "^8.4.47",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"punycode": "^2.1.1",
|
"punycode": "^2.1.1",
|
||||||
|
|
|
@ -90,7 +90,6 @@ type BookmarksAction =
|
||||||
ReturnType<typeof fetchBookmarkedStatusesRequest>
|
ReturnType<typeof fetchBookmarkedStatusesRequest>
|
||||||
| ReturnType<typeof fetchBookmarkedStatusesSuccess>
|
| ReturnType<typeof fetchBookmarkedStatusesSuccess>
|
||||||
| ReturnType<typeof fetchBookmarkedStatusesFail>
|
| ReturnType<typeof fetchBookmarkedStatusesFail>
|
||||||
| ReturnType<typeof expandBookmarkedStatuses>
|
|
||||||
| ReturnType<typeof expandBookmarkedStatusesRequest>
|
| ReturnType<typeof expandBookmarkedStatusesRequest>
|
||||||
| ReturnType<typeof expandBookmarkedStatusesSuccess>
|
| ReturnType<typeof expandBookmarkedStatusesSuccess>
|
||||||
| ReturnType<typeof expandBookmarkedStatusesFail>;
|
| ReturnType<typeof expandBookmarkedStatusesFail>;
|
||||||
|
|
|
@ -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 { Account as BaseAccount, Group, Poll, Status as BaseStatus } from 'pl-api';
|
||||||
import type { AppDispatch } from 'pl-fe/store';
|
import type { AppDispatch } from 'pl-fe/store';
|
||||||
|
|
||||||
const STATUS_IMPORT = 'STATUS_IMPORT';
|
const STATUS_IMPORT = 'STATUS_IMPORT' as const;
|
||||||
const STATUSES_IMPORT = 'STATUSES_IMPORT';
|
const STATUSES_IMPORT = 'STATUSES_IMPORT' as const;
|
||||||
const POLLS_IMPORT = 'POLLS_IMPORT';
|
const POLLS_IMPORT = 'POLLS_IMPORT' as const;
|
||||||
|
|
||||||
const importAccount = (data: BaseAccount) => importAccounts([data]);
|
|
||||||
|
|
||||||
const importAccounts = (data: Array<BaseAccount>) => (dispatch: AppDispatch) => {
|
const importAccounts = (data: Array<BaseAccount>) => (dispatch: AppDispatch) => {
|
||||||
try {
|
try {
|
||||||
|
@ -153,20 +151,19 @@ const importFetchedPoll = (poll: Poll) =>
|
||||||
dispatch(importPolls([poll]));
|
dispatch(importPolls([poll]));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type ImporterAction =
|
||||||
|
| ReturnType<typeof importStatus>
|
||||||
|
| ReturnType<typeof importStatuses>
|
||||||
|
| ReturnType<typeof importPolls>;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
STATUS_IMPORT,
|
STATUS_IMPORT,
|
||||||
STATUSES_IMPORT,
|
STATUSES_IMPORT,
|
||||||
POLLS_IMPORT,
|
POLLS_IMPORT,
|
||||||
importAccount,
|
|
||||||
importAccounts,
|
|
||||||
importGroup,
|
|
||||||
importGroups,
|
|
||||||
importStatus,
|
|
||||||
importStatuses,
|
|
||||||
importPolls,
|
|
||||||
importFetchedAccount,
|
importFetchedAccount,
|
||||||
importFetchedAccounts,
|
importFetchedAccounts,
|
||||||
importFetchedStatus,
|
importFetchedStatus,
|
||||||
importFetchedStatuses,
|
importFetchedStatuses,
|
||||||
importFetchedPoll,
|
importFetchedPoll,
|
||||||
|
type ImporterAction,
|
||||||
};
|
};
|
||||||
|
|
|
@ -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,
|
|
||||||
};
|
|
|
@ -68,7 +68,6 @@ export {
|
||||||
PLEROMA_PRELOAD_IMPORT,
|
PLEROMA_PRELOAD_IMPORT,
|
||||||
MASTODON_PRELOAD_IMPORT,
|
MASTODON_PRELOAD_IMPORT,
|
||||||
preload,
|
preload,
|
||||||
preloadPleroma,
|
|
||||||
preloadMastodon,
|
preloadMastodon,
|
||||||
type PreloadAction,
|
type PreloadAction,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,25 +1,6 @@
|
||||||
import { register, saveSettings } from './registerer';
|
export { register } 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 {
|
export {
|
||||||
SET_BROWSER_SUPPORT,
|
SET_BROWSER_SUPPORT,
|
||||||
SET_SUBSCRIPTION,
|
SET_SUBSCRIPTION,
|
||||||
CLEAR_SUBSCRIPTION,
|
CLEAR_SUBSCRIPTION,
|
||||||
SET_ALERTS,
|
} from './setter';
|
||||||
register,
|
|
||||||
changeAlerts,
|
|
||||||
};
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import type { WebPushSubscription } from 'pl-api';
|
||||||
const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const;
|
const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const;
|
||||||
const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const;
|
const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const;
|
||||||
const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_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) => ({
|
const setBrowserSupport = (value: boolean) => ({
|
||||||
type: SET_BROWSER_SUPPORT,
|
type: SET_BROWSER_SUPPORT,
|
||||||
|
@ -19,26 +18,17 @@ const clearSubscription = () => ({
|
||||||
type: CLEAR_SUBSCRIPTION,
|
type: CLEAR_SUBSCRIPTION,
|
||||||
});
|
});
|
||||||
|
|
||||||
const setAlerts = (path: Array<string>, value: any) => ({
|
|
||||||
type: SET_ALERTS,
|
|
||||||
path,
|
|
||||||
value,
|
|
||||||
});
|
|
||||||
|
|
||||||
type SetterAction =
|
type SetterAction =
|
||||||
| ReturnType<typeof setBrowserSupport>
|
| ReturnType<typeof setBrowserSupport>
|
||||||
| ReturnType<typeof setSubscription>
|
| ReturnType<typeof setSubscription>
|
||||||
| ReturnType<typeof clearSubscription>
|
| ReturnType<typeof clearSubscription>;
|
||||||
| ReturnType<typeof setAlerts>;
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
SET_BROWSER_SUPPORT,
|
SET_BROWSER_SUPPORT,
|
||||||
SET_SUBSCRIPTION,
|
SET_SUBSCRIPTION,
|
||||||
CLEAR_SUBSCRIPTION,
|
CLEAR_SUBSCRIPTION,
|
||||||
SET_ALERTS,
|
|
||||||
setBrowserSupport,
|
setBrowserSupport,
|
||||||
setSubscription,
|
setSubscription,
|
||||||
clearSubscription,
|
clearSubscription,
|
||||||
setAlerts,
|
|
||||||
type SetterAction,
|
type SetterAction,
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,21 +7,11 @@ const createPushSubscription = (params: CreatePushNotificationsSubscriptionParam
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
(dispatch: AppDispatch, getState: () => RootState) =>
|
||||||
getClient(getState).pushNotifications.createSubscription(params);
|
getClient(getState).pushNotifications.createSubscription(params);
|
||||||
|
|
||||||
const fetchPushSubscription = () =>
|
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
|
||||||
getClient(getState).pushNotifications.getSubscription();
|
|
||||||
|
|
||||||
const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) =>
|
const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
(dispatch: AppDispatch, getState: () => RootState) =>
|
||||||
getClient(getState).pushNotifications.updateSubscription(params);
|
getClient(getState).pushNotifications.updateSubscription(params);
|
||||||
|
|
||||||
const deletePushSubscription = () =>
|
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
|
||||||
getClient(getState).pushNotifications.deleteSubscription();
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
createPushSubscription,
|
createPushSubscription,
|
||||||
fetchPushSubscription,
|
|
||||||
updatePushSubscription,
|
updatePushSubscription,
|
||||||
deletePushSubscription,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -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_QUEUE: Set<string> = new Set();
|
||||||
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
|
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
|
@ -414,7 +406,6 @@ export {
|
||||||
toggleStatusMediaHidden,
|
toggleStatusMediaHidden,
|
||||||
expandStatusSpoiler,
|
expandStatusSpoiler,
|
||||||
collapseStatusSpoiler,
|
collapseStatusSpoiler,
|
||||||
toggleStatusSpoilerExpanded,
|
|
||||||
translateStatus,
|
translateStatus,
|
||||||
undoStatusTranslation,
|
undoStatusTranslation,
|
||||||
unfilterStatus,
|
unfilterStatus,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
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 { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
|
||||||
import { flattenPages } from 'pl-fe/utils/queries';
|
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 { PaginatedResponse, Account as BaseAccount } from 'pl-api';
|
||||||
import type { EntityFn } from 'pl-fe/entity-store/hooks/types';
|
import type { EntityFn } from 'pl-fe/entity-store/hooks/types';
|
||||||
|
@ -72,7 +72,6 @@ const useFollowers = (accountId: string | undefined) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useAccountList,
|
|
||||||
useBlocks,
|
useBlocks,
|
||||||
useMutes,
|
useMutes,
|
||||||
useFollowing,
|
useFollowing,
|
|
@ -2,14 +2,14 @@ import { useEffect } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntityLookup } from 'pl-fe/entity-store/hooks/useEntityLookup';
|
import { useEntityLookup } from 'pl-fe/entity-store/hooks/use-entity-lookup';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
|
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
|
||||||
|
|
||||||
import { useAccountScrobble } from './useAccountScrobble';
|
import { useAccountScrobble } from './use-account-scrobble';
|
||||||
import { useRelationship } from './useRelationship';
|
import { useRelationship } from './use-relationship';
|
||||||
|
|
||||||
import type { Account as BaseAccount } from 'pl-api';
|
import type { Account as BaseAccount } from 'pl-api';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
|
|
||||||
import type { Scrobble } from 'pl-api';
|
import type { Scrobble } from 'pl-api';
|
||||||
|
|
|
@ -2,15 +2,15 @@ import { useEffect, useMemo } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntity } from 'pl-fe/entity-store/hooks/useEntity';
|
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
|
import { type Account, normalizeAccount } from 'pl-fe/normalizers/account';
|
||||||
|
|
||||||
import { useAccountScrobble } from './useAccountScrobble';
|
import { useAccountScrobble } from './use-account-scrobble';
|
||||||
import { useRelationship } from './useRelationship';
|
import { useRelationship } from './use-relationship';
|
||||||
|
|
||||||
import type { Account as BaseAccount } from 'pl-api';
|
import type { Account as BaseAccount } from 'pl-api';
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const useAccount = (accountId?: string, opts: UseAccountOpts = {}) => {
|
||||||
{ enabled: !!accountId, transform: normalizeAccount },
|
{ enabled: !!accountId, transform: normalizeAccount },
|
||||||
);
|
);
|
||||||
|
|
||||||
const meta = useAppSelector((state) => accountId && state.accounts_meta[accountId] || {});
|
const meta = useAppSelector((state) => accountId && state.accounts_meta[accountId]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
relationship,
|
relationship,
|
|
@ -1,9 +1,9 @@
|
||||||
import { importEntities } from 'pl-fe/entity-store/actions';
|
import { importEntities } from 'pl-fe/entity-store/actions';
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction';
|
import { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
|
|
||||||
interface FollowOpts {
|
interface FollowOpts {
|
||||||
reblogs?: boolean;
|
reblogs?: boolean;
|
|
@ -1,9 +1,9 @@
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntity } from 'pl-fe/entity-store/hooks/useEntity';
|
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
|
|
||||||
import type { Relationship } from 'pl-api';
|
import type { Relationship } from 'pl-api';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/useBatchedEntities';
|
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/use-batched-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
|
|
||||||
import type { Relationship } from 'pl-api';
|
import type { Relationship } from 'pl-api';
|
||||||
|
|
|
@ -7,10 +7,10 @@ import {
|
||||||
} from 'pl-api';
|
} from 'pl-api';
|
||||||
import * as v from 'valibot';
|
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 { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
import { useAnnouncements as useUserAnnouncements } from '../announcements/useAnnouncements';
|
import { useAnnouncements as useUserAnnouncements } from '../announcements/use-announcements';
|
||||||
|
|
||||||
const useAnnouncements = () => {
|
const useAnnouncements = () => {
|
||||||
const client = useClient();
|
const client = useClient();
|
|
@ -1,6 +1,6 @@
|
||||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
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 { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
import type { AdminDomain } from 'pl-api';
|
import type { AdminDomain } from 'pl-api';
|
|
@ -1,7 +1,7 @@
|
||||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||||
import { PaginatedResponse } from 'pl-api';
|
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 { flattenPages } from 'pl-fe/utils/queries';
|
||||||
|
|
||||||
import type { AdminModerationLogEntry } from 'pl-api';
|
import type { AdminModerationLogEntry } from 'pl-api';
|
|
@ -1,6 +1,6 @@
|
||||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
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 { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
import type { AdminRelay } from 'pl-api';
|
import type { AdminRelay } from 'pl-api';
|
|
@ -1,6 +1,6 @@
|
||||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
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 { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
import type { AdminRule } from 'pl-api';
|
import type { AdminRule } from 'pl-api';
|
|
@ -1,6 +1,6 @@
|
||||||
import { EntityCallbacks } from 'pl-fe/entity-store/hooks/types';
|
import { EntityCallbacks } from 'pl-fe/entity-store/hooks/types';
|
||||||
import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction';
|
import { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import type { Account } from 'pl-fe/normalizers/account';
|
import type { Account } from 'pl-fe/normalizers/account';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { useTransaction } from 'pl-fe/entity-store/hooks/useTransaction';
|
import { useTransaction } from 'pl-fe/entity-store/hooks/use-transaction';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import type { EntityCallbacks } from 'pl-fe/entity-store/hooks/types';
|
import type { EntityCallbacks } from 'pl-fe/entity-store/hooks/types';
|
||||||
import type { Account } from 'pl-fe/normalizers/account';
|
import type { Account } from 'pl-fe/normalizers/account';
|
|
@ -2,7 +2,7 @@ import { useMutation, useQuery } from '@tanstack/react-query';
|
||||||
import { announcementReactionSchema, type AnnouncementReaction, type Announcement } from 'pl-api';
|
import { announcementReactionSchema, type AnnouncementReaction, type Announcement } from 'pl-api';
|
||||||
import * as v from 'valibot';
|
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 { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
const updateReaction = (reaction: AnnouncementReaction, count: number, me?: boolean, overwrite?: boolean) => v.parse(announcementReactionSchema, {
|
const updateReaction = (reaction: AnnouncementReaction, count: number, me?: boolean, overwrite?: boolean) => v.parse(announcementReactionSchema, {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import type { Group } from 'pl-api';
|
import type { Group } from 'pl-api';
|
||||||
import type { Account } from 'pl-fe/normalizers/account';
|
import type { Account } from 'pl-fe/normalizers/account';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
|
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
|
||||||
|
|
||||||
import type { Group as BaseGroup, CreateGroupParams } from 'pl-api';
|
import type { Group as BaseGroup, CreateGroupParams } from 'pl-api';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
|
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import type { Group } from 'pl-api';
|
import type { Group } from 'pl-api';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
|
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
const useDeleteGroup = () => {
|
const useDeleteGroup = () => {
|
||||||
const client = useClient();
|
const client = useClient();
|
|
@ -1,8 +1,8 @@
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
|
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
|
||||||
|
|
||||||
import type { Group, GroupMember as GroupMember, GroupRole } from 'pl-api';
|
import type { Group, GroupMember as GroupMember, GroupRole } from 'pl-api';
|
|
@ -2,7 +2,7 @@ import { __stub } from 'pl-fe/api';
|
||||||
import { buildStatus } from 'pl-fe/jest/factory';
|
import { buildStatus } from 'pl-fe/jest/factory';
|
||||||
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
||||||
|
|
||||||
import { useGroupMedia } from './useGroupMedia';
|
import { useGroupMedia } from './use-group-media';
|
||||||
|
|
||||||
const status = buildStatus();
|
const status = buildStatus();
|
||||||
const groupId = '1';
|
const groupId = '1';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeStatus } from 'pl-fe/normalizers/status';
|
import { normalizeStatus } from 'pl-fe/normalizers/status';
|
||||||
|
|
||||||
const useGroupMedia = (groupId: string) => {
|
const useGroupMedia = (groupId: string) => {
|
|
@ -4,7 +4,7 @@ import { __stub } from 'pl-fe/api';
|
||||||
import { buildGroupMember } from 'pl-fe/jest/factory';
|
import { buildGroupMember } from 'pl-fe/jest/factory';
|
||||||
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
||||||
|
|
||||||
import { useGroupMembers } from './useGroupMembers';
|
import { useGroupMembers } from './use-group-members';
|
||||||
|
|
||||||
const groupMember = buildGroupMember();
|
const groupMember = buildGroupMember();
|
||||||
const groupId = '1';
|
const groupId = '1';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroupMember, type GroupMember } from 'pl-fe/normalizers/group-member';
|
import { normalizeGroupMember, type GroupMember } from 'pl-fe/normalizers/group-member';
|
||||||
|
|
||||||
import type { GroupMember as BaseGroupMember, GroupRoles } from 'pl-api';
|
import type { GroupMember as BaseGroupMember, GroupRoles } from 'pl-api';
|
|
@ -1,12 +1,12 @@
|
||||||
import { GroupRoles } from 'pl-api';
|
import { GroupRoles } from 'pl-api';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useDismissEntity } from 'pl-fe/entity-store/hooks/useDismissEntity';
|
import { useDismissEntity } from 'pl-fe/entity-store/hooks/use-dismiss-entity';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeAccount } from 'pl-fe/normalizers/account';
|
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';
|
import type { ExpandedEntitiesPath } from 'pl-fe/entity-store/hooks/types';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntity } from 'pl-fe/entity-store/hooks/useEntity';
|
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import type { GroupRelationship } from 'pl-api';
|
import type { GroupRelationship } from 'pl-api';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/useBatchedEntities';
|
import { useBatchedEntities } from 'pl-fe/entity-store/hooks/use-batched-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
|
|
||||||
import type { GroupRelationship } from 'pl-api';
|
import type { GroupRelationship } from 'pl-api';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { __stub } from 'pl-fe/api';
|
||||||
import { buildGroup } from 'pl-fe/jest/factory';
|
import { buildGroup } from 'pl-fe/jest/factory';
|
||||||
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
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' });
|
const group = buildGroup({ id: '1', display_name: 'soapbox' });
|
||||||
|
|
|
@ -2,11 +2,11 @@ import { useEffect } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntity } from 'pl-fe/entity-store/hooks/useEntity';
|
import { useEntity } from 'pl-fe/entity-store/hooks/use-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
|
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';
|
import type { Group as BaseGroup } from 'pl-api';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { __stub } from 'pl-fe/api';
|
||||||
import { buildGroup } from 'pl-fe/jest/factory';
|
import { buildGroup } from 'pl-fe/jest/factory';
|
||||||
import { renderHook, waitFor } from 'pl-fe/jest/test-helpers';
|
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 group = buildGroup({ id: '1', display_name: 'soapbox' });
|
||||||
const store = {
|
const store = {
|
|
@ -1,10 +1,10 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { normalizeGroup, type Group } from 'pl-fe/normalizers/group';
|
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';
|
import type { Group as BaseGroup } from 'pl-api';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import { useGroups } from './useGroups';
|
import { useGroups } from './use-groups';
|
||||||
|
|
||||||
import type { Group } from 'pl-api';
|
import type { Group } from 'pl-api';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
import { useGroups } from './useGroups';
|
import { useGroups } from './use-groups';
|
||||||
|
|
||||||
import type { Group } from 'pl-api';
|
import type { Group } from 'pl-api';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
|
import { normalizeGroupMember } from 'pl-fe/normalizers/group-member';
|
||||||
|
|
||||||
import type { Group, GroupMember, GroupRole } from 'pl-api';
|
import type { Group, GroupMember, GroupRole } from 'pl-api';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { normalizeGroup } from 'pl-fe/normalizers/group';
|
import { normalizeGroup } from 'pl-fe/normalizers/group';
|
||||||
|
|
||||||
interface UpdateGroupParams {
|
interface UpdateGroupParams {
|
|
@ -1,9 +1,9 @@
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { useInstance } from 'pl-fe/hooks/useInstance';
|
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
|
|
||||||
const useTranslationLanguages = () => {
|
const useTranslationLanguages = () => {
|
||||||
const client = useClient();
|
const client = useClient();
|
|
@ -2,9 +2,9 @@ import { useMutation, useQuery } from '@tanstack/react-query';
|
||||||
import { type InteractionPolicies, interactionPoliciesSchema } from 'pl-api';
|
import { type InteractionPolicies, interactionPoliciesSchema } from 'pl-api';
|
||||||
import * as v from 'valibot';
|
import * as v from 'valibot';
|
||||||
|
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
import { queryClient } from 'pl-fe/queries/client';
|
import { queryClient } from 'pl-fe/queries/client';
|
||||||
|
|
||||||
const emptySchema = v.parse(interactionPoliciesSchema, {});
|
const emptySchema = v.parse(interactionPoliciesSchema, {});
|
|
@ -1,8 +1,8 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { selectEntity } from 'pl-fe/entity-store/selectors';
|
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';
|
import type{ BookmarkFolder } from 'pl-api';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
|
|
||||||
import type { BookmarkFolder } from 'pl-api';
|
import type { BookmarkFolder } from 'pl-api';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
interface CreateBookmarkFolderParams {
|
interface CreateBookmarkFolderParams {
|
||||||
name: string;
|
name: string;
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/useDeleteEntity';
|
import { useDeleteEntity } from 'pl-fe/entity-store/hooks/use-delete-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
const useDeleteBookmarkFolder = () => {
|
const useDeleteBookmarkFolder = () => {
|
||||||
const client = useClient();
|
const client = useClient();
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useCreateEntity } from 'pl-fe/entity-store/hooks/useCreateEntity';
|
import { useCreateEntity } from 'pl-fe/entity-store/hooks/use-create-entity';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
|
|
||||||
interface UpdateBookmarkFolderParams {
|
interface UpdateBookmarkFolderParams {
|
||||||
name: string;
|
name: string;
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
interface UseCommunityStreamOpts {
|
interface UseCommunityStreamOpts {
|
||||||
onlyMedia?: boolean;
|
onlyMedia?: boolean;
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
const useDirectStream = () => useTimelineStream('direct');
|
const useDirectStream = () => useTimelineStream('direct');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId } as any);
|
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId } as any);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
const useHashtagStream = (tag: string) => useTimelineStream('hashtag', { tag });
|
const useHashtagStream = (tag: string) => useTimelineStream('hashtag', { tag });
|
||||||
|
|
|
@ -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 useListStream = (listId: string) => {
|
||||||
const { isLoggedIn } = useLoggedIn();
|
const { isLoggedIn } = useLoggedIn();
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
interface UsePublicStreamOpts {
|
interface UsePublicStreamOpts {
|
||||||
onlyMedia?: boolean;
|
onlyMedia?: boolean;
|
|
@ -1,4 +1,4 @@
|
||||||
import { useTimelineStream } from './useTimelineStream';
|
import { useTimelineStream } from './use-timeline-stream';
|
||||||
|
|
||||||
interface UseRemoteStreamOpts {
|
interface UseRemoteStreamOpts {
|
||||||
instance: string;
|
instance: string;
|
|
@ -1,8 +1,8 @@
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useInstance } from 'pl-fe/hooks/useInstance';
|
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||||
import { getAccessToken } from 'pl-fe/utils/auth';
|
import { getAccessToken } from 'pl-fe/utils/auth';
|
||||||
|
|
||||||
import type { StreamingEvent } from 'pl-api';
|
import type { StreamingEvent } from 'pl-api';
|
|
@ -11,17 +11,17 @@ import { useStatContext } from 'pl-fe/contexts/stat-context';
|
||||||
import { importEntities } from 'pl-fe/entity-store/actions';
|
import { importEntities } from 'pl-fe/entity-store/actions';
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { selectEntity } from 'pl-fe/entity-store/selectors';
|
import { selectEntity } from 'pl-fe/entity-store/selectors';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { useLoggedIn } from 'pl-fe/hooks/useLoggedIn';
|
import { useLoggedIn } from 'pl-fe/hooks/use-logged-in';
|
||||||
import messages from 'pl-fe/messages';
|
import messages from 'pl-fe/messages';
|
||||||
import { queryClient } from 'pl-fe/queries/client';
|
import { queryClient } from 'pl-fe/queries/client';
|
||||||
import { useSettingsStore } from 'pl-fe/stores/settings';
|
import { useSettingsStore } from 'pl-fe/stores/settings';
|
||||||
import { getUnreadChatsCount, updateChatListItem } from 'pl-fe/utils/chats';
|
import { getUnreadChatsCount, updateChatListItem } from 'pl-fe/utils/chats';
|
||||||
import { play, soundCache } from 'pl-fe/utils/sounds';
|
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 { Announcement, AnnouncementReaction, FollowRelationshipUpdate, Relationship, StreamingEvent } from 'pl-api';
|
||||||
import type { AppDispatch, RootState } from 'pl-fe/store';
|
import type { AppDispatch, RootState } from 'pl-fe/store';
|
|
@ -1,7 +1,7 @@
|
||||||
import { Entities } from 'pl-fe/entity-store/entities';
|
import { Entities } from 'pl-fe/entity-store/entities';
|
||||||
import { useEntities } from 'pl-fe/entity-store/hooks/useEntities';
|
import { useEntities } from 'pl-fe/entity-store/hooks/use-entities';
|
||||||
import { useClient } from 'pl-fe/hooks/useClient';
|
import { useClient } from 'pl-fe/hooks/use-client';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
|
|
||||||
import type { TrendsLink } from 'pl-api';
|
import type { TrendsLink } from 'pl-api';
|
||||||
|
|
|
@ -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 };
|
|
|
@ -5,7 +5,7 @@ import { useIntl, FormattedMessage } from 'react-intl';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { fetchRelationships } from 'pl-fe/actions/accounts';
|
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 Badge from 'pl-fe/components/badge';
|
||||||
import Card, { CardBody } from 'pl-fe/components/ui/card';
|
import Card, { CardBody } from 'pl-fe/components/ui/card';
|
||||||
import HStack from 'pl-fe/components/ui/hstack';
|
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 Text from 'pl-fe/components/ui/text';
|
||||||
import ActionButton from 'pl-fe/features/ui/components/action-button';
|
import ActionButton from 'pl-fe/features/ui/components/action-button';
|
||||||
import { UserPanel } from 'pl-fe/features/ui/util/async-components';
|
import { UserPanel } from 'pl-fe/features/ui/util/async-components';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';
|
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';
|
||||||
|
|
||||||
import { showAccountHoverCard } from './hover-account-wrapper';
|
import { showAccountHoverCard } from './hover-account-wrapper';
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Text from 'pl-fe/components/ui/text';
|
||||||
import VerificationBadge from 'pl-fe/components/verification-badge';
|
import VerificationBadge from 'pl-fe/components/verification-badge';
|
||||||
import Emojify from 'pl-fe/features/emoji/emojify';
|
import Emojify from 'pl-fe/features/emoji/emojify';
|
||||||
import ActionButton from 'pl-fe/features/ui/components/action-button';
|
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 { getAcct } from 'pl-fe/utils/accounts';
|
||||||
import { displayFqn } from 'pl-fe/utils/state';
|
import { displayFqn } from 'pl-fe/utils/state';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||||
import { useIntl, type IntlShape } from 'react-intl';
|
import { useIntl, type IntlShape } from 'react-intl';
|
||||||
import { TransitionMotion, spring } from 'react-motion';
|
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';
|
import { isNumber, roundDown } from 'pl-fe/utils/numbers';
|
||||||
|
|
||||||
const obfuscatedCount = (count: number): string => {
|
const obfuscatedCount = (count: number): string => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { FormattedDate } from 'react-intl';
|
||||||
|
|
||||||
import Stack from 'pl-fe/components/ui/stack';
|
import Stack from 'pl-fe/components/ui/stack';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
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 { getTextDirection } from 'pl-fe/utils/rtl';
|
||||||
|
|
||||||
import AnnouncementContent from './announcement-content';
|
import AnnouncementContent from './announcement-content';
|
||||||
|
|
|
@ -5,11 +5,11 @@ import { FormattedMessage } from 'react-intl';
|
||||||
import ReactSwipeableViews from 'react-swipeable-views';
|
import ReactSwipeableViews from 'react-swipeable-views';
|
||||||
import { createSelector } from 'reselect';
|
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 Card from 'pl-fe/components/ui/card';
|
||||||
import HStack from 'pl-fe/components/ui/hstack';
|
import HStack from 'pl-fe/components/ui/hstack';
|
||||||
import Widget from 'pl-fe/components/ui/widget';
|
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';
|
import Announcement from './announcement';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import unicodeMapping from 'pl-fe/features/emoji/mapping';
|
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 { joinPublicPath } from 'pl-fe/utils/static';
|
||||||
|
|
||||||
import type { Map as ImmutableMap } from 'immutable';
|
import type { Map as ImmutableMap } from 'immutable';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import React, { useState } from 'react';
|
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 AnimatedNumber from 'pl-fe/components/animated-number';
|
||||||
import unicodeMapping from 'pl-fe/features/emoji/mapping';
|
import unicodeMapping from 'pl-fe/features/emoji/mapping';
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@ import clsx from 'clsx';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TransitionMotion, spring } from 'react-motion';
|
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 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';
|
import Reaction from './reaction';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Suspense } from 'react';
|
import React, { Suspense } from 'react';
|
||||||
|
|
||||||
import { MediaGallery } from 'pl-fe/features/ui/util/async-components';
|
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 { useModalsStore } from 'pl-fe/stores/modals';
|
||||||
|
|
||||||
import { isMediaVisible } from './statuses/sensitive-content-overlay';
|
import { isMediaVisible } from './statuses/sensitive-content-overlay';
|
||||||
|
|
|
@ -4,7 +4,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||||
|
|
||||||
import { accountSearch } from 'pl-fe/actions/accounts';
|
import { accountSearch } from 'pl-fe/actions/accounts';
|
||||||
import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input';
|
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 { Menu } from 'pl-fe/components/dropdown-menu';
|
||||||
import type { InputThemes } from 'pl-fe/components/ui/input';
|
import type { InputThemes } from 'pl-fe/components/ui/input';
|
||||||
|
|
|
@ -4,7 +4,7 @@ import HStack from 'pl-fe/components/ui/hstack';
|
||||||
import Icon from 'pl-fe/components/ui/icon';
|
import Icon from 'pl-fe/components/ui/icon';
|
||||||
import Stack from 'pl-fe/components/ui/stack';
|
import Stack from 'pl-fe/components/ui/stack';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
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 buildingCommunityIcon = require('@tabler/icons/outline/building-community.svg');
|
||||||
const homeIcon = require('@tabler/icons/outline/home-2.svg');
|
const homeIcon = require('@tabler/icons/outline/home-2.svg');
|
||||||
|
|
|
@ -4,7 +4,7 @@ import React from 'react';
|
||||||
|
|
||||||
import Avatar from 'pl-fe/components/ui/avatar';
|
import Avatar from 'pl-fe/components/ui/avatar';
|
||||||
import HStack from 'pl-fe/components/ui/hstack';
|
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 { makeGetAccount } from 'pl-fe/selectors';
|
||||||
|
|
||||||
import type { Account } from 'pl-fe/normalizers/account';
|
import type { Account } from 'pl-fe/normalizers/account';
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import IconButton from 'pl-fe/components/icon-button';
|
import IconButton from 'pl-fe/components/icon-button';
|
||||||
import { DatePicker } from 'pl-fe/features/ui/util/async-components';
|
import { DatePicker } from 'pl-fe/features/ui/util/async-components';
|
||||||
import { useFeatures } from 'pl-fe/hooks/useFeatures';
|
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||||
import { useInstance } from 'pl-fe/hooks/useInstance';
|
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
birthdayPlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birthday' },
|
birthdayPlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birthday' },
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { FormattedMessage } from 'react-intl';
|
||||||
import { fetchBirthdayReminders } from 'pl-fe/actions/accounts';
|
import { fetchBirthdayReminders } from 'pl-fe/actions/accounts';
|
||||||
import Widget from 'pl-fe/components/ui/widget';
|
import Widget from 'pl-fe/components/ui/widget';
|
||||||
import AccountContainer from 'pl-fe/containers/account-container';
|
import AccountContainer from 'pl-fe/containers/account-container';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
|
|
||||||
const timeToMidnight = () => {
|
const timeToMidnight = () => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { unblockDomain } from 'pl-fe/actions/domain-blocks';
|
||||||
import HStack from 'pl-fe/components/ui/hstack';
|
import HStack from 'pl-fe/components/ui/hstack';
|
||||||
import IconButton from 'pl-fe/components/ui/icon-button';
|
import IconButton from 'pl-fe/components/ui/icon-button';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
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({
|
const messages = defineMessages({
|
||||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
||||||
|
|
|
@ -11,7 +11,7 @@ import VerificationBadge from 'pl-fe/components/verification-badge';
|
||||||
import Emojify from 'pl-fe/features/emoji/emojify';
|
import Emojify from 'pl-fe/features/emoji/emojify';
|
||||||
import EventActionButton from 'pl-fe/features/event/components/event-action-button';
|
import EventActionButton from 'pl-fe/features/event/components/event-action-button';
|
||||||
import EventDate from 'pl-fe/features/event/components/event-date';
|
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';
|
import type { Status as StatusEntity } from 'pl-fe/normalizers/status';
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,4 @@ const ForkAwesomeIcon: React.FC<IForkAwesomeIcon> = ({ id, className, fixedWidth
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { type IForkAwesomeIcon, ForkAwesomeIcon as default };
|
export { ForkAwesomeIcon as default };
|
||||||
|
|
|
@ -7,8 +7,8 @@ import Button from 'pl-fe/components/ui/button';
|
||||||
import HStack from 'pl-fe/components/ui/hstack';
|
import HStack from 'pl-fe/components/ui/hstack';
|
||||||
import Stack from 'pl-fe/components/ui/stack';
|
import Stack from 'pl-fe/components/ui/stack';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
import Text from 'pl-fe/components/ui/text';
|
||||||
import { useInstance } from 'pl-fe/hooks/useInstance';
|
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||||
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
|
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
|
||||||
|
|
||||||
const acceptedGdpr = !!localStorage.getItem('plfe:gdpr');
|
const acceptedGdpr = !!localStorage.getItem('plfe:gdpr');
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Helmet as ReactHelmet } from 'react-helmet-async';
|
import { Helmet as ReactHelmet } from 'react-helmet-async';
|
||||||
|
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
import { useInstance } from 'pl-fe/hooks/useInstance';
|
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||||
import { useSettings } from 'pl-fe/hooks/useSettings';
|
import { useSettings } from 'pl-fe/hooks/use-settings';
|
||||||
import { RootState } from 'pl-fe/store';
|
import { RootState } from 'pl-fe/store';
|
||||||
import FaviconService from 'pl-fe/utils/favicon-service';
|
import FaviconService from 'pl-fe/utils/favicon-service';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import debounce from 'lodash/debounce';
|
||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
|
|
||||||
import { fetchAccount } from 'pl-fe/actions/accounts';
|
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 { isMobile } from 'pl-fe/is-mobile';
|
||||||
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';
|
import { useAccountHoverCardStore } from 'pl-fe/stores/account-hover-card';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||||
import { locationSearch } from 'pl-fe/actions/events';
|
import { locationSearch } from 'pl-fe/actions/events';
|
||||||
import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input';
|
import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input';
|
||||||
import Icon from 'pl-fe/components/icon';
|
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';
|
import AutosuggestLocation from './autosuggest-location';
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import Blurhash from 'pl-fe/components/blurhash';
|
||||||
import Icon from 'pl-fe/components/icon';
|
import Icon from 'pl-fe/components/icon';
|
||||||
import StillImage from 'pl-fe/components/still-image';
|
import StillImage from 'pl-fe/components/still-image';
|
||||||
import { MIMETYPE_ICONS } from 'pl-fe/components/upload';
|
import { MIMETYPE_ICONS } from 'pl-fe/components/upload';
|
||||||
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
|
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
|
||||||
import { useSettings } from 'pl-fe/hooks/useSettings';
|
import { useSettings } from 'pl-fe/hooks/use-settings';
|
||||||
import { truncateFilename } from 'pl-fe/utils/media';
|
import { truncateFilename } from 'pl-fe/utils/media';
|
||||||
|
|
||||||
import { isIOS } from '../is-mobile';
|
import { isIOS } from '../is-mobile';
|
||||||
|
@ -564,7 +564,4 @@ const MediaGallery: React.FC<IMediaGallery> = (props) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export { MediaGallery as default };
|
||||||
type IMediaGallery,
|
|
||||||
MediaGallery as default,
|
|
||||||
};
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { cancelReplyCompose } from 'pl-fe/actions/compose';
|
import { cancelReplyCompose } from 'pl-fe/actions/compose';
|
||||||
import { saveDraftStatus } from 'pl-fe/actions/draft-statuses';
|
import { saveDraftStatus } from 'pl-fe/actions/draft-statuses';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { usePrevious } from 'pl-fe/hooks/usePrevious';
|
import { usePrevious } from 'pl-fe/hooks/use-previous';
|
||||||
import { useModalsStore } from 'pl-fe/stores/modals';
|
import { useModalsStore } from 'pl-fe/stores/modals';
|
||||||
|
|
||||||
import type { ModalType } from 'pl-fe/features/ui/components/modal-root';
|
import type { ModalType } from 'pl-fe/features/ui/components/modal-root';
|
||||||
|
|
|
@ -2,8 +2,8 @@ import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import Text from 'pl-fe/components/ui/text';
|
import Text from 'pl-fe/components/ui/text';
|
||||||
import { usePlFeConfig } from 'pl-fe/hooks/usePlFeConfig';
|
import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
|
||||||
import { useSettings } from 'pl-fe/hooks/useSettings';
|
import { useSettings } from 'pl-fe/hooks/use-settings';
|
||||||
|
|
||||||
interface INavlinks {
|
interface INavlinks {
|
||||||
type: string;
|
type: string;
|
||||||
|
|
|
@ -107,9 +107,9 @@ const ParsedContent: React.FC<IParsedContent> = (({ html, mentions, hasQuote, em
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
transform(reactNode) {
|
transform(reactNode, _domNode, index) {
|
||||||
if (typeof reactNode === 'string') {
|
if (typeof reactNode === 'string') {
|
||||||
return <Emojify text={reactNode} emojis={emojiMap} />;
|
return <Emojify key={index} text={reactNode} emojis={emojiMap} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return reactNode as JSX.Element;
|
return reactNode as JSX.Element;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import HStack from 'pl-fe/components/ui/hstack';
|
||||||
import Stack from 'pl-fe/components/ui/stack';
|
import Stack from 'pl-fe/components/ui/stack';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
import Text from 'pl-fe/components/ui/text';
|
||||||
import Tooltip from 'pl-fe/components/ui/tooltip';
|
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';
|
import RelativeTimestamp from '../relative-timestamp';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||||
import { vote } from 'pl-fe/actions/polls';
|
import { vote } from 'pl-fe/actions/polls';
|
||||||
import Stack from 'pl-fe/components/ui/stack';
|
import Stack from 'pl-fe/components/ui/stack';
|
||||||
import Text from 'pl-fe/components/ui/text';
|
import Text from 'pl-fe/components/ui/text';
|
||||||
import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch';
|
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||||
import { useAppSelector } from 'pl-fe/hooks/useAppSelector';
|
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
|
||||||
import { useModalsStore } from 'pl-fe/stores/modals';
|
import { useModalsStore } from 'pl-fe/stores/modals';
|
||||||
|
|
||||||
import PollFooter from './poll-footer';
|
import PollFooter from './poll-footer';
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue