pl-fe: add subscribers visibility scope

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2024-12-21 01:52:28 +01:00
parent f9cce2eded
commit a3af999976
6 changed files with 19 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "1.0.0-rc.5",
"version": "1.0.0-rc.6",
"type": "module",
"homepage": "https://github.com/mkljczk/pl-fe/tree/develop/packages/pl-api",
"repository": {

View File

@ -101,7 +101,7 @@
"multiselect-react-dropdown": "^2.0.25",
"mutative": "^1.1.0",
"path-browserify": "^1.0.1",
"pl-api": "^1.0.0-rc.5",
"pl-api": "^1.0.0-rc.6",
"postcss": "^8.4.49",
"process": "^0.11.10",
"punycode": "^2.1.1",

View File

@ -28,6 +28,8 @@ const messages = defineMessages({
local_long: { id: 'privacy.local.long', defaultMessage: 'Only visible on your instance' },
list_short: { id: 'privacy.list.short', defaultMessage: 'List only' },
list_long: { id: 'privacy.list.long', defaultMessage: 'Visible to members of a list' },
subscribers_short: { id: 'privacy.subscribers.short', defaultMessage: 'Subscribers-only' },
subscribers_long: { id: 'privacy.subscribers.long', defaultMessage: 'Post to users subscribing you only' },
change_privacy: { id: 'privacy.change', defaultMessage: 'Adjust post privacy' },
local: { id: 'privacy.local', defaultMessage: '{privacy} (local-only)' },
@ -66,6 +68,12 @@ const getItems = (features: Features, lists: ReturnType<typeof getOrderedLists>,
text: intl.formatMessage(messages.mutuals_only_short),
meta: intl.formatMessage(messages.mutuals_only_long),
} : undefined,
features.visibilitySubscribers ? {
icon: require('@tabler/icons/outline/coin.svg'),
value: 'subscribers',
text: intl.formatMessage(messages.subscribers_short),
meta: intl.formatMessage(messages.subscribers_long),
} : undefined,
{
icon: require('@tabler/icons/outline/mail.svg'),
value: 'direct',

View File

@ -17,6 +17,7 @@ const messages: Record<string, MessageDescriptor> = defineMessages({
local: { id: 'status.visibility.local', defaultMessage: 'The post is only visible to users on your instance' },
list: { id: 'status.visibility.list', defaultMessage: 'The post is only visible to the members of a list' },
list_named: { id: 'status.visibility.list.named', defaultMessage: 'The post is only visible to the members of a {name} list' },
subscribers: { id: 'status.visibility.subscribers', defaultMessage: 'The post is only visible to users subscribing the author' },
});
const STATUS_TYPE_ICONS: Record<string, string> = {
@ -25,6 +26,7 @@ const STATUS_TYPE_ICONS: Record<string, string> = {
mutuals_only: require('@tabler/icons/outline/users-group.svg'),
local: require('@tabler/icons/outline/affiliate.svg'),
list: require('@tabler/icons/outline/list.svg'),
subscribers: require('@tabler/icons/outline/coin.svg'),
};
const StatusTypeIcon: React.FC<IStatusTypeIcon> = ({ status }) => {

View File

@ -1289,6 +1289,8 @@
"privacy.private.short": "Followers-only",
"privacy.public.long": "Post to public timelines",
"privacy.public.short": "Public",
"privacy.subscribers.long": "Post to users subscribing you only",
"privacy.subscribers.short": "Subscribers-only",
"privacy.unlisted.long": "Do not post to public timelines",
"privacy.unlisted.short": "Unlisted",
"profile_dropdown.add_account": "Add an existing account",
@ -1540,6 +1542,7 @@
"status.visibility.local": "The post is only visible to users on your instance",
"status.visibility.mutuals_only": "The post is only visible to people who mutually follow the author",
"status.visibility.private": "The post is only visible to followers of the author",
"status.visibility.subscribers": "The post is only visible to users subscribing the author",
"status.wrench": "Wrench reaction",
"status_list.queue_label": "Click to see {count} new {count, plural, one {post} other {posts}}",
"statuses.quote_tombstone": "Post is unavailable.",

View File

@ -8216,10 +8216,10 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
pl-api@^1.0.0-rc.5:
version "1.0.0-rc.5"
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.5.tgz#b82d27c7fc1a50a36bdd98a623b9a349de78c3e3"
integrity sha512-+FtJNGZvZEVaceMBTuXzRw/NnNbJypPJsCSPvonZNtIe9almSDfL3UGVZLgtERhXNjgH2ZxYWubfkb6d6ZaQjA==
pl-api@^1.0.0-rc.6:
version "1.0.0-rc.6"
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.6.tgz#58e37a995f34dbad1ea92760ef13eb6563630ccd"
integrity sha512-1kTUowZcQnTbGQqK0XfTzbRRdN+mcHDFpbjwl9M6WqnWrOmekJxrBaQ/hnBprbkarDsm/EUun+BuTRFxUNDfvw==
dependencies:
blurhash "^2.0.5"
http-link-header "^1.1.3"