diff --git a/app/javascript/flavours/glitch/actions/accounts.js b/app/javascript/flavours/glitch/actions/accounts.js index d4f18ff2d7562d..6d9544d651fe3c 100644 --- a/app/javascript/flavours/glitch/actions/accounts.js +++ b/app/javascript/flavours/glitch/actions/accounts.js @@ -106,7 +106,6 @@ export function fetchAccount(id) { api(getState).get(`/api/v1/accounts/${id}`).then(response => { dispatch(importFetchedAccount(response.data)); - }).then(() => { dispatch(fetchAccountSuccess()); }).catch(error => { dispatch(fetchAccountFail(id, error)); diff --git a/app/javascript/flavours/glitch/actions/identity_proofs.js b/app/javascript/flavours/glitch/actions/identity_proofs.js deleted file mode 100644 index 10398395660345..00000000000000 --- a/app/javascript/flavours/glitch/actions/identity_proofs.js +++ /dev/null @@ -1,31 +0,0 @@ -import api from '../api'; - -export const IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST = 'IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST'; -export const IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS = 'IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS'; -export const IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL = 'IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL'; - -export const fetchAccountIdentityProofs = accountId => (dispatch, getState) => { - dispatch(fetchAccountIdentityProofsRequest(accountId)); - - api(getState).get(`/api/v1/accounts/${accountId}/identity_proofs`) - .then(({ data }) => dispatch(fetchAccountIdentityProofsSuccess(accountId, data))) - .catch(err => dispatch(fetchAccountIdentityProofsFail(accountId, err))); -}; - -export const fetchAccountIdentityProofsRequest = id => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST, - id, -}); - -export const fetchAccountIdentityProofsSuccess = (accountId, identity_proofs) => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS, - accountId, - identity_proofs, -}); - -export const fetchAccountIdentityProofsFail = (accountId, err) => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL, - accountId, - err, - skipNotFound: true, -}); diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js index f30e193c4ff7ef..506e5ee6adbcb1 100644 --- a/app/javascript/flavours/glitch/actions/importer/normalizer.js +++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js @@ -1,8 +1,8 @@ import escapeTextContentForBrowser from 'escape-html'; -import emojify from 'flavours/glitch/features/emoji/emoji'; -import { autoHideCW } from 'flavours/glitch/utils/content_warning'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; +import emojify from '../../features/emoji/emoji'; +import { autoHideCW } from '../../utils/content_warning'; +import { unescapeHTML } from '../../utils/html'; const domParser = new DOMParser(); diff --git a/app/javascript/flavours/glitch/actions/interactions.js b/app/javascript/flavours/glitch/actions/interactions.js index eb61b5bc1a4b73..60f46f0cbcedb3 100644 --- a/app/javascript/flavours/glitch/actions/interactions.js +++ b/app/javascript/flavours/glitch/actions/interactions.js @@ -93,6 +93,7 @@ export function reblogRequest(status) { return { type: REBLOG_REQUEST, status: status, + skipLoading: true, }; } @@ -100,6 +101,7 @@ export function reblogSuccess(status) { return { type: REBLOG_SUCCESS, status: status, + skipLoading: true, }; } @@ -108,6 +110,7 @@ export function reblogFail(status, error) { type: REBLOG_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -115,6 +118,7 @@ export function unreblogRequest(status) { return { type: UNREBLOG_REQUEST, status: status, + skipLoading: true, }; } @@ -122,6 +126,7 @@ export function unreblogSuccess(status) { return { type: UNREBLOG_SUCCESS, status: status, + skipLoading: true, }; } @@ -130,6 +135,7 @@ export function unreblogFail(status, error) { type: UNREBLOG_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -163,6 +169,7 @@ export function favouriteRequest(status) { return { type: FAVOURITE_REQUEST, status: status, + skipLoading: true, }; } @@ -170,6 +177,7 @@ export function favouriteSuccess(status) { return { type: FAVOURITE_SUCCESS, status: status, + skipLoading: true, }; } @@ -178,6 +186,7 @@ export function favouriteFail(status, error) { type: FAVOURITE_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -185,6 +194,7 @@ export function unfavouriteRequest(status) { return { type: UNFAVOURITE_REQUEST, status: status, + skipLoading: true, }; } @@ -192,6 +202,7 @@ export function unfavouriteSuccess(status) { return { type: UNFAVOURITE_SUCCESS, status: status, + skipLoading: true, }; } @@ -200,6 +211,7 @@ export function unfavouriteFail(status, error) { type: UNFAVOURITE_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -209,7 +221,7 @@ export function bookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { dispatch(importFetchedStatus(response.data)); - dispatch(bookmarkSuccess(status)); + dispatch(bookmarkSuccess(status, response.data)); }).catch(function (error) { dispatch(bookmarkFail(status, error)); }); @@ -222,7 +234,7 @@ export function unbookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => { dispatch(importFetchedStatus(response.data)); - dispatch(unbookmarkSuccess(status)); + dispatch(unbookmarkSuccess(status, response.data)); }).catch(error => { dispatch(unbookmarkFail(status, error)); }); @@ -236,10 +248,11 @@ export function bookmarkRequest(status) { }; } -export function bookmarkSuccess(status) { +export function bookmarkSuccess(status, response) { return { type: BOOKMARK_SUCCESS, status: status, + response: response, }; } @@ -258,10 +271,11 @@ export function unbookmarkRequest(status) { }; } -export function unbookmarkSuccess(status) { +export function unbookmarkSuccess(status, response) { return { type: UNBOOKMARK_SUCCESS, status: status, + response: response, }; } @@ -454,6 +468,7 @@ export function pinRequest(status) { return { type: PIN_REQUEST, status, + skipLoading: true, }; } @@ -461,6 +476,7 @@ export function pinSuccess(status) { return { type: PIN_SUCCESS, status, + skipLoading: true, }; } @@ -469,6 +485,7 @@ export function pinFail(status, error) { type: PIN_FAIL, status, error, + skipLoading: true, }; } @@ -489,6 +506,7 @@ export function unpinRequest(status) { return { type: UNPIN_REQUEST, status, + skipLoading: true, }; } @@ -496,6 +514,7 @@ export function unpinSuccess(status) { return { type: UNPIN_SUCCESS, status, + skipLoading: true, }; } @@ -504,6 +523,7 @@ export function unpinFail(status, error) { type: UNPIN_FAIL, status, error, + skipLoading: true, }; } diff --git a/app/javascript/flavours/glitch/actions/mutes.js b/app/javascript/flavours/glitch/actions/mutes.js index 4af927d932166e..fb041078b84488 100644 --- a/app/javascript/flavours/glitch/actions/mutes.js +++ b/app/javascript/flavours/glitch/actions/mutes.js @@ -1,9 +1,8 @@ -import { openModal } from 'flavours/glitch/actions/modal'; - import api, { getLinks } from '../api'; import { fetchRelationships } from './accounts'; import { importFetchedAccounts } from './importer'; +import { openModal } from './modal'; export const MUTES_FETCH_REQUEST = 'MUTES_FETCH_REQUEST'; export const MUTES_FETCH_SUCCESS = 'MUTES_FETCH_SUCCESS'; diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 4b4b48b7da3097..e63f10359b58c6 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -5,10 +5,10 @@ import { List as ImmutableList } from 'immutable'; import { compareId } from 'flavours/glitch/compare_id'; import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; -import { requestNotificationPermission } from 'flavours/glitch/utils/notifications'; import api, { getLinks } from '../api'; +import { unescapeHTML } from '../utils/html'; +import { requestNotificationPermission } from '../utils/notifications'; import { fetchFollowRequests, fetchRelationships } from './accounts'; import { @@ -21,10 +21,7 @@ import { submitMarkers } from './markers'; import { register as registerPushNotifications } from './push_notifications'; import { saveSettings } from './settings'; - - - -export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; +export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; // tracking the notif cleaning request @@ -65,7 +62,7 @@ defineMessages({ const fetchRelatedRelationships = (dispatch, notifications) => { const accountIds = notifications.filter(item => ['follow', 'follow_request', 'admin.sign_up'].indexOf(item.type) !== -1).map(item => item.account.id); - if (accountIds > 0) { + if (accountIds.length > 0) { dispatch(fetchRelationships(accountIds)); } }; @@ -131,6 +128,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) { const body = (notification.status && notification.status.spoiler_text.length > 0) ? notification.status.spoiler_text : unescapeHTML(notification.status ? notification.status.content : ''); const notify = new Notification(title, { body, icon: notification.account.avatar, tag: notification.id }); + notify.addEventListener('click', () => { window.focus(); notify.close(); @@ -141,7 +139,6 @@ export function updateNotifications(notification, intlMessages, intlLocale) { const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); - const excludeTypesFromFilter = filter => { const allTypes = ImmutableList([ 'follow', diff --git a/app/javascript/flavours/glitch/actions/pin_statuses.js b/app/javascript/flavours/glitch/actions/pin_statuses.js index 8aca199e9776b2..baa10d15627d66 100644 --- a/app/javascript/flavours/glitch/actions/pin_statuses.js +++ b/app/javascript/flavours/glitch/actions/pin_statuses.js @@ -1,10 +1,8 @@ -import { me } from 'flavours/glitch/initial_state'; - import api from '../api'; +import { me } from '../initial_state'; import { importFetchedStatuses } from './importer'; - export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST'; export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS'; export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL'; diff --git a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js index 336bbc68692dd6..b3d3850e31d115 100644 --- a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js +++ b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js @@ -1,5 +1,7 @@ import api from '../../api'; +import { me } from '../../initial_state'; import { pushNotificationsSetting } from '../../settings'; +import { decode as decodeBase64 } from '../../utils/base64'; import { setBrowserSupport, setSubscription, clearSubscription } from './setter'; @@ -10,13 +12,7 @@ const urlBase64ToUint8Array = (base64String) => { .replace(/-/g, '+') .replace(/_/g, '/'); - const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); - - for (let i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; + return decodeBase64(base64); }; const getApplicationServerKey = () => document.querySelector('[name="applicationServerKey"]').getAttribute('content'); @@ -36,7 +32,7 @@ const subscribe = (registration) => const unsubscribe = ({ registration, subscription }) => subscription ? subscription.unsubscribe().then(() => registration) : registration; -const sendSubscriptionToBackend = (getState, subscription, me) => { +const sendSubscriptionToBackend = (subscription) => { const params = { subscription }; if (me) { @@ -46,7 +42,7 @@ const sendSubscriptionToBackend = (getState, subscription, me) => { } } - return api(getState).post('/api/web/push_subscriptions', params).then(response => response.data); + return api().post('/api/web/push_subscriptions', params).then(response => response.data); }; // Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload @@ -55,7 +51,6 @@ const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' export function register () { return (dispatch, getState) => { dispatch(setBrowserSupport(supportsPushNotifications)); - const me = getState().getIn(['meta', 'me']); if (supportsPushNotifications) { if (!getApplicationServerKey()) { @@ -79,13 +74,13 @@ export function register () { } else { // Something went wrong, try to subscribe again return unsubscribe({ registration, subscription }).then(subscribe).then( - subscription => sendSubscriptionToBackend(getState, subscription, me)); + subscription => sendSubscriptionToBackend(subscription)); } } // No subscription, try to subscribe return subscribe(registration).then( - subscription => sendSubscriptionToBackend(getState, subscription, me)); + subscription => sendSubscriptionToBackend(subscription)); }) .then(subscription => { // If we got a PushSubscription (and not a subscription object from the backend) @@ -128,10 +123,9 @@ export function saveSettings() { const alerts = state.get('alerts'); const data = { alerts }; - api(getState).put(`/api/web/push_subscriptions/${subscription.get('id')}`, { + api().put(`/api/web/push_subscriptions/${subscription.get('id')}`, { data, }).then(() => { - const me = getState().getIn(['meta', 'me']); if (me) { pushNotificationsSetting.set(me, data); } diff --git a/app/javascript/flavours/glitch/actions/settings.js b/app/javascript/flavours/glitch/actions/settings.js index 120ae133eda631..3685b0684e0b83 100644 --- a/app/javascript/flavours/glitch/actions/settings.js +++ b/app/javascript/flavours/glitch/actions/settings.js @@ -26,7 +26,7 @@ const debouncedSave = debounce((dispatch, getState) => { const data = getState().get('settings').filter((_, path) => path !== 'saved').toJS(); - api(getState).put('/api/web/settings', { data }) + api().put('/api/web/settings', { data }) .then(() => dispatch({ type: SETTING_SAVE })) .catch(error => dispatch(showAlertForError(error))); }, 5000, { trailing: true }); diff --git a/app/javascript/flavours/glitch/actions/streaming.js b/app/javascript/flavours/glitch/actions/streaming.js index f1c44d2e292bc1..d8341a5c1682ce 100644 --- a/app/javascript/flavours/glitch/actions/streaming.js +++ b/app/javascript/flavours/glitch/actions/streaming.js @@ -1,7 +1,6 @@ // @ts-check -import { getLocale } from 'flavours/glitch/locales'; - +import { getLocale } from '../locales'; import { connectStream } from '../stream'; import { @@ -68,8 +67,8 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti // @ts-expect-error if (pollingId) { - clearTimeout(pollingId); - pollingId = null; + // @ts-ignore + clearTimeout(pollingId); pollingId = null; } if (options.fillGaps) { @@ -86,8 +85,8 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti } }, - onReceive (data) { - switch(data.event) { + onReceive(data) { + switch (data.event) { case 'update': // @ts-expect-error dispatch(updateTimeline(timelineId, JSON.parse(data.payload), options.accept)); diff --git a/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx b/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx new file mode 100644 index 00000000000000..b7225fc92e01e4 --- /dev/null +++ b/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx @@ -0,0 +1,214 @@ +import { fromJS } from 'immutable'; + +import type { StatusLike } from '../hashtag_bar'; +import { computeHashtagBarForStatus } from '../hashtag_bar'; + +function createStatus( + content: string, + hashtags: string[], + hasMedia = false, + spoilerText?: string, +) { + return fromJS({ + tags: hashtags.map((name) => ({ name })), + contentHtml: content, + media_attachments: hasMedia ? ['fakeMedia'] : [], + spoiler_text: spoilerText, + }) as unknown as StatusLike; // need to force the type here, as it is not properly defined +} + +describe('computeHashtagBarForStatus', () => { + it('does nothing when there are no tags', () => { + const status = createStatus('

Simple text

', []); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text

"`, + ); + }); + + it('displays out of band hashtags in the bar', () => { + const status = createStatus( + '

Simple text #hashtag

', + ['hashtag', 'test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['test']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text #hashtag

"`, + ); + }); + + it('does not truncate the contents when the last child is a text node', () => { + const status = createStatus( + 'this is a #test. Some more text', + ['test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"this is a #test. Some more text"`, + ); + }); + + it('extract tags from the last line', () => { + const status = createStatus( + '

Simple text

#hashtag

', + ['hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['hashtag']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text

"`, + ); + }); + + it('does not include tags from content', () => { + const status = createStatus( + '

Simple text with a #hashtag

#hashtag

', + ['hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text with a #hashtag

"`, + ); + }); + + it('works with one line status and hashtags', () => { + const status = createStatus( + '

#test. And another #hashtag

', + ['hashtag', 'test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test. And another #hashtag

"`, + ); + }); + + it('de-duplicate accentuated characters with case differences', () => { + const status = createStatus( + '

Text

#éaa #Éaa

', + ['éaa'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['Éaa']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text

"`, + ); + }); + + it('handles server-side normalized tags with accentuated characters', () => { + const status = createStatus( + '

Text

#éaa #Éaa

', + ['eaa'], // The server may normalize the hashtags in the `tags` attribute + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['Éaa']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text

"`, + ); + }); + + it('does not display in bar a hashtag in content with a case difference', () => { + const status = createStatus( + '

Text #Éaa

#éaa

', + ['éaa'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text #Éaa

"`, + ); + }); + + it('does not modify a status with a line of hashtags only', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test #hashtag

"`, + ); + }); + + it('puts the hashtags in the bar if a status content has hashtags in the only line and has a media', () => { + const status = createStatus( + '

This is my content! #hashtag

', + ['hashtag'], + true, + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

This is my content! #hashtag

"`, + ); + }); + + it('puts the hashtags in the bar if a status content is only hashtags and has a media', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + true, + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['test', 'hashtag']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot(`""`); + }); + + it('does not use the hashtag bar if the status content is only hashtags, has a CW and a media', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + true, + 'My CW text', + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test #hashtag

"`, + ); + }); +}); diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx index 518464b040364e..8aaafc18b93647 100644 --- a/app/javascript/flavours/glitch/components/account.jsx +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -6,7 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Skeleton } from 'flavours/glitch/components/skeleton'; -import { me } from 'flavours/glitch/initial_state'; + +import { me } from '../initial_state'; import { Avatar } from './avatar'; import { DisplayName } from './display_name'; @@ -14,7 +15,6 @@ import { IconButton } from './icon_button'; import Permalink from './permalink'; import { RelativeTimestamp } from './relative_timestamp'; - const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, diff --git a/app/javascript/flavours/glitch/components/animated_number.tsx b/app/javascript/flavours/glitch/components/animated_number.tsx index 2beb6efbe4030c..05a7e01898411e 100644 --- a/app/javascript/flavours/glitch/components/animated_number.tsx +++ b/app/javascript/flavours/glitch/components/animated_number.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import { TransitionMotion, spring } from 'react-motion'; diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx index 0e7014e6b1050c..eb25f5a6436786 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -1,9 +1,10 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { unicodeMapping } from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; import { assetHost } from 'flavours/glitch/utils/config'; +import { unicodeMapping } from '../features/emoji/emoji_unicode_mapping_light'; + export default class AutosuggestEmoji extends PureComponent { static propTypes = { @@ -27,7 +28,7 @@ export default class AutosuggestEmoji extends PureComponent { } return ( -
+
= ({ ); }; -const MemoizedBlurhash = React.memo(Blurhash); +const MemoizedBlurhash = memo(Blurhash); export { MemoizedBlurhash as Blurhash }; diff --git a/app/javascript/flavours/glitch/components/display_name.tsx b/app/javascript/flavours/glitch/components/display_name.tsx index a140394320bd8d..3ad00b58553c12 100644 --- a/app/javascript/flavours/glitch/components/display_name.tsx +++ b/app/javascript/flavours/glitch/components/display_name.tsx @@ -4,9 +4,8 @@ import classNames from 'classnames'; import type { List } from 'immutable'; -import type { Account } from 'flavours/glitch/types/resources'; - import { autoPlayGif } from '../initial_state'; +import type { Account } from '../types/resources'; import { Skeleton } from './skeleton'; diff --git a/app/javascript/flavours/glitch/components/domain.tsx b/app/javascript/flavours/glitch/components/domain.tsx index 50c5c256ec527d..f4a3b9d4b69d2a 100644 --- a/app/javascript/flavours/glitch/components/domain.tsx +++ b/app/javascript/flavours/glitch/components/domain.tsx @@ -1,5 +1,4 @@ import { useCallback } from 'react'; -import * as React from 'react'; import { defineMessages, useIntl } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx index 3dbac58b549fd3..5aaaf3e357ebca 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx +++ b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx @@ -6,7 +6,7 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { openModal } from 'flavours/glitch/actions/modal'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import InlineAccount from 'flavours/glitch/components/inline_account'; import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; diff --git a/app/javascript/flavours/glitch/components/gifv.tsx b/app/javascript/flavours/glitch/components/gifv.tsx index 96071ced4299d0..c2be591128f458 100644 --- a/app/javascript/flavours/glitch/components/gifv.tsx +++ b/app/javascript/flavours/glitch/components/gifv.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; interface Props { src: string; diff --git a/app/javascript/flavours/glitch/components/hashtag.jsx b/app/javascript/flavours/glitch/components/hashtag.jsx index 9821cf185827ed..956834b47acc0b 100644 --- a/app/javascript/flavours/glitch/components/hashtag.jsx +++ b/app/javascript/flavours/glitch/components/hashtag.jsx @@ -25,11 +25,11 @@ class SilentErrorBoundary extends Component { error: false, }; - componentDidCatch () { + componentDidCatch() { this.setState({ error: true }); } - render () { + render() { if (this.state.error) { return null; } diff --git a/app/javascript/flavours/glitch/components/hashtag_bar.tsx b/app/javascript/flavours/glitch/components/hashtag_bar.tsx new file mode 100644 index 00000000000000..91fa9221983a70 --- /dev/null +++ b/app/javascript/flavours/glitch/components/hashtag_bar.tsx @@ -0,0 +1,234 @@ +import { useState, useCallback } from 'react'; + +import { FormattedMessage } from 'react-intl'; + +import { Link } from 'react-router-dom'; + +import type { List, Record } from 'immutable'; + +import { groupBy, minBy } from 'lodash'; + +import { getStatusContent } from './status_content'; + +// Fit on a single line on desktop +const VISIBLE_HASHTAGS = 3; + +// Those types are not correct, they need to be replaced once this part of the state is typed +export type TagLike = Record<{ name: string }>; +export type StatusLike = Record<{ + tags: List; + contentHTML: string; + media_attachments: List; + spoiler_text?: string; +}>; + +function normalizeHashtag(hashtag: string) { + return ( + hashtag && hashtag.startsWith('#') ? hashtag.slice(1) : hashtag + ).normalize('NFKC'); +} + +function isNodeLinkHashtag(element: Node): element is HTMLLinkElement { + return ( + element instanceof HTMLAnchorElement && + // it may be a starting with a hashtag + (element.textContent?.[0] === '#' || + // or a # + element.previousSibling?.textContent?.[ + element.previousSibling.textContent.length - 1 + ] === '#') + ); +} + +/** + * Removes duplicates from an hashtag list, case-insensitive, keeping only the best one + * "Best" here is defined by the one with the more casing difference (ie, the most camel-cased one) + * @param hashtags The list of hashtags + * @returns The input hashtags, but with only 1 occurence of each (case-insensitive) + */ +function uniqueHashtagsWithCaseHandling(hashtags: string[]) { + const groups = groupBy(hashtags, (tag) => + tag.normalize('NFKD').toLowerCase(), + ); + + return Object.values(groups).map((tags) => { + if (tags.length === 1) return tags[0]; + + // The best match is the one where we have the less difference between upper and lower case letter count + const best = minBy(tags, (tag) => { + const upperCase = Array.from(tag).reduce( + (acc, char) => (acc += char.toUpperCase() === char ? 1 : 0), + 0, + ); + + const lowerCase = tag.length - upperCase; + + return Math.abs(lowerCase - upperCase); + }); + + return best ?? tags[0]; + }); +} + +// Create the collator once, this is much more efficient +const collator = new Intl.Collator(undefined, { + sensitivity: 'base', // we use this to emulate the ASCII folding done on the server-side, hopefuly more efficiently +}); + +function localeAwareInclude(collection: string[], value: string) { + const normalizedValue = value.normalize('NFKC'); + + return !!collection.find( + (item) => collator.compare(item.normalize('NFKC'), normalizedValue) === 0, + ); +} + +// We use an intermediate function here to make it easier to test +export function computeHashtagBarForStatus(status: StatusLike): { + statusContentProps: { statusContent: string }; + hashtagsInBar: string[]; +} { + let statusContent = getStatusContent(status); + + const tagNames = status + .get('tags') + .map((tag) => tag.get('name')) + .toJS(); + + // this is returned if we stop the processing early, it does not change what is displayed + const defaultResult = { + statusContentProps: { statusContent }, + hashtagsInBar: [], + }; + + // return early if this status does not have any tags + if (tagNames.length === 0) return defaultResult; + + const template = document.createElement('template'); + template.innerHTML = statusContent.trim(); + + const lastChild = template.content.lastChild; + + if (!lastChild || lastChild.nodeType === Node.TEXT_NODE) return defaultResult; + + template.content.removeChild(lastChild); + const contentWithoutLastLine = template; + + // First, try to parse + const contentHashtags = Array.from( + contentWithoutLastLine.content.querySelectorAll('a[href]'), + ).reduce((result, link) => { + if (isNodeLinkHashtag(link)) { + if (link.textContent) result.push(normalizeHashtag(link.textContent)); + } + return result; + }, []); + + // Now we parse the last line, and try to see if it only contains hashtags + const lastLineHashtags: string[] = []; + // try to see if the last line is only hashtags + let onlyHashtags = true; + + const normalizedTagNames = tagNames.map((tag) => tag.normalize('NFKC')); + + Array.from(lastChild.childNodes).forEach((node) => { + if (isNodeLinkHashtag(node) && node.textContent) { + const normalized = normalizeHashtag(node.textContent); + + if (!localeAwareInclude(normalizedTagNames, normalized)) { + // stop here, this is not a real hashtag, so consider it as text + onlyHashtags = false; + return; + } + + if (!localeAwareInclude(contentHashtags, normalized)) + // only add it if it does not appear in the rest of the content + lastLineHashtags.push(normalized); + } else if (node.nodeType !== Node.TEXT_NODE || node.nodeValue?.trim()) { + // not a space + onlyHashtags = false; + } + }); + + const hashtagsInBar = tagNames.filter((tag) => { + const normalizedTag = tag.normalize('NFKC'); + // the tag does not appear at all in the status content, it is an out-of-band tag + return ( + !localeAwareInclude(contentHashtags, normalizedTag) && + !localeAwareInclude(lastLineHashtags, normalizedTag) + ); + }); + + const isOnlyOneLine = contentWithoutLastLine.content.childElementCount === 0; + const hasMedia = status.get('media_attachments').size > 0; + const hasSpoiler = !!status.get('spoiler_text'); + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- due to https://github.com/microsoft/TypeScript/issues/9998 + if (onlyHashtags && ((hasMedia && !hasSpoiler) || !isOnlyOneLine)) { + // if the last line only contains hashtags, and we either: + // - have other content in the status + // - dont have other content, but a media and no CW. If it has a CW, then we do not remove the content to avoid having an empty content behind the CW button + statusContent = contentWithoutLastLine.innerHTML; + // and add the tags to the bar + hashtagsInBar.push(...lastLineHashtags); + } + + return { + statusContentProps: { statusContent }, + hashtagsInBar: uniqueHashtagsWithCaseHandling(hashtagsInBar), + }; +} + +/** + * This function will process a status to, at the same time (avoiding parsing it twice): + * - build the HashtagBar for this status + * - remove the last-line hashtags from the status content + * @param status The status to process + * @returns Props to be passed to the component, and the hashtagBar to render + */ +export function getHashtagBarForStatus(status: StatusLike) { + const { statusContentProps, hashtagsInBar } = + computeHashtagBarForStatus(status); + + return { + statusContentProps, + hashtagBar: , + }; +} + +const HashtagBar: React.FC<{ + hashtags: string[]; +}> = ({ hashtags }) => { + const [expanded, setExpanded] = useState(false); + const handleClick = useCallback(() => { + setExpanded(true); + }, []); + + if (hashtags.length === 0) { + return null; + } + + const revealedHashtags = expanded + ? hashtags + : hashtags.slice(0, VISIBLE_HASHTAGS); + + return ( +
+ {revealedHashtags.map((hashtag) => ( + + #{hashtag} + + ))} + + {!expanded && hashtags.length > VISIBLE_HASHTAGS && ( + + )} +
+ ); +}; diff --git a/app/javascript/flavours/glitch/components/icon.tsx b/app/javascript/flavours/glitch/components/icon.tsx index 765aa89aec050b..3d091c7059e18c 100644 --- a/app/javascript/flavours/glitch/components/icon.tsx +++ b/app/javascript/flavours/glitch/components/icon.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props extends React.HTMLAttributes { diff --git a/app/javascript/flavours/glitch/components/icon_button.tsx b/app/javascript/flavours/glitch/components/icon_button.tsx index ecc418773c68d4..8bca60fa971f78 100644 --- a/app/javascript/flavours/glitch/components/icon_button.tsx +++ b/app/javascript/flavours/glitch/components/icon_button.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { PureComponent } from 'react'; import classNames from 'classnames'; @@ -33,7 +33,7 @@ interface States { activate: boolean; deactivate: boolean; } -export class IconButton extends React.PureComponent { +export class IconButton extends PureComponent { static defaultProps = { size: 18, active: false, diff --git a/app/javascript/flavours/glitch/components/icon_with_badge.tsx b/app/javascript/flavours/glitch/components/icon_with_badge.tsx index 319c0b2389221b..8898f413299480 100644 --- a/app/javascript/flavours/glitch/components/icon_with_badge.tsx +++ b/app/javascript/flavours/glitch/components/icon_with_badge.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { Icon } from './icon'; const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num); diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx index bef40c07fabb78..8efa969f9bff56 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx @@ -3,6 +3,7 @@ import { cloneElement, Component } from 'react'; import getRectFromEntry from '../features/ui/util/get_rect_from_entry'; import scheduleIdleTask from '../features/ui/util/schedule_idle_task'; + // Diff these props in the "unrendered" state const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight']; @@ -38,7 +39,6 @@ export default class IntersectionObserverArticle extends Component { return true; } - componentDidMount () { const { intersectionObserverWrapper, id } = this.props; @@ -106,24 +106,24 @@ export default class IntersectionObserverArticle extends Component { const { children, id, index, listLength, cachedHeight } = this.props; const { isIntersecting, isHidden } = this.state; - const style = {}; - if (!isIntersecting && (isHidden || cachedHeight)) { - style.height = `${this.height || cachedHeight || 150}px`; - style.opacity = 0; - style.overflow = 'hidden'; + return ( +
+ {children && cloneElement(children, { hidden: true })} +
+ ); } return ( -
- {children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} +
+ {children && cloneElement(children, { hidden: false })}
); } diff --git a/app/javascript/flavours/glitch/components/media_gallery.jsx b/app/javascript/flavours/glitch/components/media_gallery.jsx index 21fdc47416cf79..5b17f10ba70478 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.jsx +++ b/app/javascript/flavours/glitch/components/media_gallery.jsx @@ -11,7 +11,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; + +import { autoPlayGif, displayMedia, useBlurhash } from '../initial_state'; import { IconButton } from './icon_button'; diff --git a/app/javascript/flavours/glitch/components/modal_root.jsx b/app/javascript/flavours/glitch/components/modal_root.jsx index cebc1040a7fd5d..f338c4ec0eda5c 100644 --- a/app/javascript/flavours/glitch/components/modal_root.jsx +++ b/app/javascript/flavours/glitch/components/modal_root.jsx @@ -110,8 +110,9 @@ class ModalRoot extends PureComponent { } _handleModalClose () { - this.unlistenHistory(); - + if (this.unlistenHistory) { + this.unlistenHistory(); + } const { state } = this.history.location; if (state && state.mastodonModalKey === this._modalHistoryKey) { this.history.goBack(); diff --git a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx index d0eedc64122462..015f74dcaeabed 100644 --- a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx +++ b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; export const NotSignedInIndicator: React.FC = () => ( diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx index 1a290c91dea70c..9a103bdb0cc53e 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx +++ b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { removePictureInPicture } from 'flavours/glitch/actions/picture_in_picture'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; class PictureInPicturePlaceholder extends PureComponent { diff --git a/app/javascript/flavours/glitch/components/poll.jsx b/app/javascript/flavours/glitch/components/poll.jsx index 03dd6b576e21bc..7b69d302a72b0f 100644 --- a/app/javascript/flavours/glitch/components/poll.jsx +++ b/app/javascript/flavours/glitch/components/poll.jsx @@ -10,13 +10,12 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import escapeTextContentForBrowser from 'escape-html'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import emojify from 'flavours/glitch/features/emoji/emoji'; import Motion from 'flavours/glitch/features/ui/util/optional_motion'; import { RelativeTimestamp } from './relative_timestamp'; - const messages = defineMessages({ closed: { id: 'poll.closed', diff --git a/app/javascript/flavours/glitch/components/radio_button.tsx b/app/javascript/flavours/glitch/components/radio_button.tsx index fbd7859d80d312..d0a565b9e65aa3 100644 --- a/app/javascript/flavours/glitch/components/radio_button.tsx +++ b/app/javascript/flavours/glitch/components/radio_button.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props { diff --git a/app/javascript/flavours/glitch/components/scrollable_list.jsx b/app/javascript/flavours/glitch/components/scrollable_list.jsx index a281e561546213..82d32185e187cf 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.jsx +++ b/app/javascript/flavours/glitch/components/scrollable_list.jsx @@ -10,11 +10,11 @@ import { connect } from 'react-redux'; import { supportsPassiveEvents } from 'detect-passive-events'; import { throttle } from 'lodash'; -import IntersectionObserverArticleContainer from 'flavours/glitch/containers/intersection_observer_article_container'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; -import IntersectionObserverWrapper from 'flavours/glitch/features/ui/util/intersection_observer_wrapper'; +import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container'; import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../features/ui/util/fullscreen'; +import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'; import { LoadMore } from './load_more'; import { LoadPending } from './load_pending'; diff --git a/app/javascript/flavours/glitch/components/server_hero_image.tsx b/app/javascript/flavours/glitch/components/server_hero_image.tsx index be05059e49b27f..68b7f03df39744 100644 --- a/app/javascript/flavours/glitch/components/server_hero_image.tsx +++ b/app/javascript/flavours/glitch/components/server_hero_image.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/skeleton.tsx b/app/javascript/flavours/glitch/components/skeleton.tsx index 30ff0d8525ffb0..d6f1aed7238f87 100644 --- a/app/javascript/flavours/glitch/components/skeleton.tsx +++ b/app/javascript/flavours/glitch/components/skeleton.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - interface Props { width?: number | string; height?: number | string; diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 2b5e782a12910c..94f5848e0a7e3d 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -12,15 +12,18 @@ import { HotKeys } from 'react-hotkeys'; import PictureInPicturePlaceholder from 'flavours/glitch/components/picture_in_picture_placeholder'; import PollContainer from 'flavours/glitch/containers/poll_container'; import NotificationOverlayContainer from 'flavours/glitch/features/notifications/containers/overlay_container'; -import { displayMedia, visibleReactions } from 'flavours/glitch/initial_state'; import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router'; import Card from '../features/status/components/card'; +// We use the component (and not the container) since we do not want +// to use the progress bar to show download progress import Bundle from '../features/ui/components/bundle'; import { MediaGallery, Video, Audio } from '../features/ui/util/async-components'; +import { displayMedia, visibleReactions } from '../initial_state'; import AttachmentList from './attachment_list'; +import { getHashtagBarForStatus } from './hashtag_bar'; import StatusActionBar from './status_action_bar'; import StatusContent from './status_content'; import StatusHeader from './status_header'; @@ -788,6 +791,9 @@ class Status extends ImmutablePureComponent { muted, }, 'focusable'); + const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); + contentMedia.push(hashtagBar); + return (
{ return !(textMatchesTarget(text, origin, host) || textMatchesTarget(text.toLowerCase(), origin, host)); }; +/** + * + * @param {any} status + * @returns {string} + */ +export function getStatusContent(status) { + return status.getIn(['translation', 'contentHtml']) || status.get('contentHtml'); +} + class TranslateButton extends PureComponent { static propTypes = { @@ -118,6 +127,7 @@ class StatusContent extends PureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, + statusContent: PropTypes.string, expanded: PropTypes.bool, collapsed: PropTypes.bool, onExpandedToggle: PropTypes.func, @@ -327,6 +337,7 @@ class StatusContent extends PureComponent { tagLinks, rewriteMentions, intl, + statusContent, } = this.props; const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; @@ -334,7 +345,7 @@ class StatusContent extends PureComponent { const targetLanguages = this.props.languages?.get(status.get('language') || 'und'); const renderTranslate = this.props.onTranslate && this.context.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && targetLanguages?.includes(contentLocale); - const content = { __html: status.getIn(['translation', 'contentHtml']) || status.get('contentHtml') }; + const content = { __html: statusContent ?? getStatusContent(status) }; const spoilerContent = { __html: status.getIn(['translation', 'spoilerHtml']) || status.get('spoilerHtml') }; const language = status.getIn(['translation', 'language']) || status.get('language'); const classNames = classnames('status__content', { diff --git a/app/javascript/flavours/glitch/components/status_list.jsx b/app/javascript/flavours/glitch/components/status_list.jsx index f28c42582c6a49..87825839e54cae 100644 --- a/app/javascript/flavours/glitch/components/status_list.jsx +++ b/app/javascript/flavours/glitch/components/status_list.jsx @@ -6,7 +6,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { debounce } from 'lodash'; import RegenerationIndicator from 'flavours/glitch/components/regeneration_indicator'; -import StatusContainer from 'flavours/glitch/containers/status_container'; + +import StatusContainer from '../containers/status_container'; import { LoadGap } from './load_gap'; import ScrollableList from './scrollable_list'; diff --git a/app/javascript/flavours/glitch/components/timeline_hint.tsx b/app/javascript/flavours/glitch/components/timeline_hint.tsx index df7787bf67b418..bf2a2d8bbaeda7 100644 --- a/app/javascript/flavours/glitch/components/timeline_hint.tsx +++ b/app/javascript/flavours/glitch/components/timeline_hint.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; interface Props { diff --git a/app/javascript/flavours/glitch/containers/account_container.jsx b/app/javascript/flavours/glitch/containers/account_container.jsx index f204545852bf2d..a134452e77210f 100644 --- a/app/javascript/flavours/glitch/containers/account_container.jsx +++ b/app/javascript/flavours/glitch/containers/account_container.jsx @@ -9,12 +9,12 @@ import { unblockAccount, muteAccount, unmuteAccount, -} from 'flavours/glitch/actions/accounts'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import Account from 'flavours/glitch/components/account'; -import { unfollowModal } from 'flavours/glitch/initial_state'; -import { makeGetAccount } from 'flavours/glitch/selectors'; +} from '../actions/accounts'; +import { openModal } from '../actions/modal'; +import { initMuteModal } from '../actions/mutes'; +import Account from '../components/account'; +import { unfollowModal } from '../initial_state'; +import { makeGetAccount } from '../selectors'; const messages = defineMessages({ unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' }, diff --git a/app/javascript/flavours/glitch/containers/compose_container.jsx b/app/javascript/flavours/glitch/containers/compose_container.jsx index f92bf9797b4f65..f76550678ed2e1 100644 --- a/app/javascript/flavours/glitch/containers/compose_container.jsx +++ b/app/javascript/flavours/glitch/containers/compose_container.jsx @@ -2,12 +2,13 @@ import { PureComponent } from 'react'; import { Provider } from 'react-redux'; -import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis'; -import { hydrateStore } from 'flavours/glitch/actions/store'; -import Compose from 'flavours/glitch/features/standalone/compose'; -import initialState from 'flavours/glitch/initial_state'; -import { IntlProvider } from 'flavours/glitch/locales'; -import { store } from 'flavours/glitch/store'; +import { fetchCustomEmojis } from '../actions/custom_emojis'; +import { hydrateStore } from '../actions/store'; +import Compose from '../features/standalone/compose'; +import initialState from '../initial_state'; +import { IntlProvider } from '../locales'; +import { store } from '../store'; + if (initialState) { store.dispatch(hydrateStore(initialState)); diff --git a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js index e7958f466036aa..75501967424645 100644 --- a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js +++ b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js @@ -1,9 +1,8 @@ import { connect } from 'react-redux'; -import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dropdown_menu'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; -import DropdownMenu from 'flavours/glitch/components/dropdown_menu'; - +import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu'; +import { openModal, closeModal } from '../actions/modal'; +import DropdownMenu from '../components/dropdown_menu'; import { isUserTouching } from '../is_mobile'; /** diff --git a/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js b/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js index 11aedd527875d2..8d9bda6704326f 100644 --- a/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js +++ b/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux'; -import { setHeight } from 'flavours/glitch/actions/height_cache'; -import IntersectionObserverArticle from 'flavours/glitch/components/intersection_observer_article'; +import { setHeight } from '../actions/height_cache'; +import IntersectionObserverArticle from '../components/intersection_observer_article'; const makeMapStateToProps = (state, props) => ({ cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]), diff --git a/app/javascript/flavours/glitch/features/about/index.jsx b/app/javascript/flavours/glitch/features/about/index.jsx index feecc2dd6fbe12..79b5f8114e9d82 100644 --- a/app/javascript/flavours/glitch/features/about/index.jsx +++ b/app/javascript/flavours/glitch/features/about/index.jsx @@ -10,9 +10,9 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; +import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; import Column from 'flavours/glitch/components/column'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { ServerHeroImage } from 'flavours/glitch/components/server_hero_image'; import { Skeleton } from 'flavours/glitch/components/skeleton'; import Account from 'flavours/glitch/containers/account_container'; diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx index aa3146839634a6..aaa872b0aa4c33 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx @@ -6,11 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; - - export default class MediaItem extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.jsx b/app/javascript/flavours/glitch/features/account_gallery/index.jsx index 2da679fc27dde5..d3f845ddc4668a 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/index.jsx @@ -8,17 +8,18 @@ import { connect } from 'react-redux'; import { lookupAccount, fetchAccount } from 'flavours/glitch/actions/accounts'; import { openModal } from 'flavours/glitch/actions/modal'; -import { expandAccountMediaTimeline } from 'flavours/glitch/actions/timelines'; import { LoadMore } from 'flavours/glitch/components/load_more'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; -import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import Column from 'flavours/glitch/features/ui/components/column'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { getAccountGallery } from 'flavours/glitch/selectors'; +import { expandAccountMediaTimeline } from '../../actions/timelines'; +import HeaderContainer from '../account_timeline/containers/header_container'; +import Column from '../ui/components/column'; + import MediaItem from './components/media_item'; const mapStateToProps = (state, { params: { acct, id } }) => { diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx index 1e91ffa1123e1e..c38c1efa1b2d8d 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx @@ -7,10 +7,11 @@ import { NavLink, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import ActionBar from 'flavours/glitch/features/account/components/action_bar'; -import InnerHeader from 'flavours/glitch/features/account/components/header'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import ActionBar from '../../account/components/action_bar'; +import InnerHeader from '../../account/components/header'; + import MemorialNote from './memorial_note'; import MovedNote from './moved_note'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx index 75b254b0956fae..5bd0a23d3d733a 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx @@ -2,7 +2,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; -import { initEditAccountNote } from 'flavours/glitch/actions/account_notes'; +import { initEditAccountNote } from '../../../actions/account_notes'; import { followAccount, unfollowAccount, @@ -10,19 +10,18 @@ import { unmuteAccount, pinAccount, unpinAccount, -} from 'flavours/glitch/actions/accounts'; -import { initBlockModal } from 'flavours/glitch/actions/blocks'; +} from '../../../actions/accounts'; +import { initBlockModal } from '../../../actions/blocks'; import { mentionCompose, directCompose, -} from 'flavours/glitch/actions/compose'; -import { blockDomain, unblockDomain } from 'flavours/glitch/actions/domain_blocks'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import { initReport } from 'flavours/glitch/actions/reports'; -import { unfollowModal } from 'flavours/glitch/initial_state'; -import { makeGetAccount, getAccountHidden } from 'flavours/glitch/selectors'; - +} from '../../../actions/compose'; +import { blockDomain, unblockDomain } from '../../../actions/domain_blocks'; +import { openModal } from '../../../actions/modal'; +import { initMuteModal } from '../../../actions/mutes'; +import { initReport } from '../../../actions/reports'; +import { unfollowModal } from '../../../initial_state'; +import { makeGetAccount, getAccountHidden } from '../../../selectors'; import Header from '../components/header'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.jsx b/app/javascript/flavours/glitch/features/account_timeline/index.jsx index 03c989e969f33a..45a599f24ccb77 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/index.jsx @@ -7,13 +7,13 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; -import { lookupAccount, fetchAccount } from 'flavours/glitch/actions/accounts'; import { TimelineHint } from 'flavours/glitch/components/timeline_hint'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { getAccountHidden } from 'flavours/glitch/selectors'; +import { lookupAccount, fetchAccount } from '../../actions/accounts'; import { fetchFeaturedTags } from '../../actions/featured_tags'; import { expandAccountFeaturedTimeline, expandAccountTimeline } from '../../actions/timelines'; import { LoadingIndicator } from '../../components/loading_indicator'; @@ -23,13 +23,6 @@ import Column from '../ui/components/column'; import LimitedAccountHint from './components/limited_account_hint'; import HeaderContainer from './containers/header_container'; - - - - - - - const emptyList = ImmutableList(); const mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = false }) => { diff --git a/app/javascript/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx index 80c8af134a27c6..5b9f38ecb15ff1 100644 --- a/app/javascript/flavours/glitch/features/audio/index.jsx +++ b/app/javascript/flavours/glitch/features/audio/index.jsx @@ -9,14 +9,13 @@ import { is } from 'immutable'; import { throttle, debounce } from 'lodash'; -import { Blurhash } from 'flavours/glitch/components/blurhash'; import { Icon } from 'flavours/glitch/components/icon'; import { formatTime, getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video'; -import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; - -import Visualizer from './visualizer'; +import { Blurhash } from '../../components/blurhash'; +import { displayMedia, useBlurhash } from '../../initial_state'; +import Visualizer from './visualizer'; const messages = defineMessages({ play: { id: 'video.play', defaultMessage: 'Play' }, diff --git a/app/javascript/flavours/glitch/features/blocks/index.jsx b/app/javascript/flavours/glitch/features/blocks/index.jsx index aa5479b2086867..ac5ebfd46ed2c7 100644 --- a/app/javascript/flavours/glitch/features/blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/blocks/index.jsx @@ -8,13 +8,12 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchBlocks, expandBlocks } from 'flavours/glitch/actions/blocks'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; - +import { fetchBlocks, expandBlocks } from '../../actions/blocks'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { LoadingIndicator } from '../../components/loading_indicator'; import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.blocks', defaultMessage: 'Blocked users' }, diff --git a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js index dbfc4594e1801b..1e9f1213945a03 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { changeColumnParams } from '../../../actions/columns'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.jsx b/app/javascript/flavours/glitch/features/community_timeline/index.jsx index f9436df0d0145d..e894cb932f0332 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/community_timeline/index.jsx @@ -7,15 +7,16 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { connectCommunityStream } from 'flavours/glitch/actions/streaming'; -import { expandCommunityTimeline } from 'flavours/glitch/actions/timelines'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import { domain } from 'flavours/glitch/initial_state'; +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { connectCommunityStream } from '../../actions/streaming'; +import { expandCommunityTimeline } from '../../actions/timelines'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import StatusListContainer from '../ui/containers/status_list_container'; + import ColumnSettingsContainer from './containers/column_settings_container'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx index 5f00da52c4b56a..3efa2edf0a2838 100644 --- a/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx @@ -1,8 +1,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; export default class AutosuggestAccount extends ImmutablePureComponent { @@ -14,8 +14,8 @@ export default class AutosuggestAccount extends ImmutablePureComponent { const { account } = this.props; return ( -
-
+
+
); diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx index e3ed2070433810..72fc4c4ab88a4c 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx @@ -41,7 +41,7 @@ const messages = defineMessages({ class ComposeForm extends ImmutablePureComponent { static propTypes = { intl: PropTypes.object.isRequired, - text: PropTypes.string, + text: PropTypes.string.isRequired, suggestions: ImmutablePropTypes.list, spoiler: PropTypes.bool, privacy: PropTypes.string, diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx index 01cd3d5dd28f8a..5330eeeca5a08a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx @@ -103,12 +103,12 @@ class ModifierPickerMenu extends PureComponent { return (
- - - - - - + + + + + +
); } diff --git a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx index 383a9db52845f2..059c3fd6e4280a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx @@ -5,10 +5,11 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; import Permalink from 'flavours/glitch/components/permalink'; import { profileLink } from 'flavours/glitch/utils/backend_links'; +import { Avatar } from '../../../components/avatar'; + import ActionBar from './action_bar'; export default class NavigationBar extends ImmutablePureComponent { diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx index 41b90a78dba538..289556e81350e5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx @@ -9,7 +9,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AutosuggestInput from 'flavours/glitch/components/autosuggest_input'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import { pollLimits } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx index d0f13cc33c9f12..06775230fe40d0 100644 --- a/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { defineMessages, injectIntl } from 'react-intl'; +import { injectIntl, defineMessages } from 'react-intl'; import Dropdown from './dropdown'; diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx index 51da8f297d170e..661dff3d54dbd5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx @@ -6,8 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import AccountContainer from 'flavours/glitch/containers/account_container'; + +import { IconButton } from '../../../components/icon_button'; +import AccountContainer from '../../../containers/account_container'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, @@ -17,8 +18,8 @@ class ReplyIndicator extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map, - intl: PropTypes.object.isRequired, onCancel: PropTypes.func, + intl: PropTypes.object.isRequired, }; handleClick = () => { @@ -28,7 +29,6 @@ class ReplyIndicator extends ImmutablePureComponent { } }; - // Rendering. render () { const { status, intl } = this.props; @@ -36,39 +36,32 @@ class ReplyIndicator extends ImmutablePureComponent { return null; } + const content = { __html: status.get('contentHtml') }; + const account = status.get('account'); - const content = status.get('content'); - const attachments = status.get('media_attachments'); - // The result. return ( -
-
- +
+
+
+ {account && ( )} -
-
- {attachments.size > 0 && ( +
+ +
+ + {status.get('media_attachments').size > 0 && ( )} -
+
); } diff --git a/app/javascript/flavours/glitch/features/compose/components/search.jsx b/app/javascript/flavours/glitch/features/compose/components/search.jsx index 09627bb4fa7a48..ed717f215b1c8c 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search.jsx @@ -82,13 +82,9 @@ class Search extends PureComponent { }; handleClear = e => { - const { - onClear, - submitted, - value, - } = this.props; + const { value, submitted, onClear } = this.props; - e.preventDefault(); // Prevents focus change ?? + e.preventDefault(); if (value.length > 0 || submitted) { onClear(); @@ -160,6 +156,7 @@ class Search extends PureComponent { search.forget(e); } } + break; } }; @@ -342,6 +339,7 @@ class Search extends PureComponent {
+
{options.length === 0 && ( <> @@ -361,6 +359,7 @@ class Search extends PureComponent {
)} + {options.length > 0 && ( <>

diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx b/app/javascript/flavours/glitch/features/compose/components/search_results.jsx index a9687ffef592a8..e8379a9326e231 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.jsx @@ -5,13 +5,14 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag'; import { Icon } from 'flavours/glitch/components/icon'; import { LoadMore } from 'flavours/glitch/components/load_more'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import StatusContainer from 'flavours/glitch/containers/status_container'; import { SearchSection } from 'flavours/glitch/features/explore/components/search_section'; +import { ImmutableHashtag as Hashtag } from '../../../components/hashtag'; +import AccountContainer from '../../../containers/account_container'; +import StatusContainer from '../../../containers/status_container'; + const INITIAL_PAGE_LIMIT = 10; const withoutLastResult = list => { diff --git a/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx b/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx index 780e063b2ef3b0..166d022b88ac79 100644 --- a/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx @@ -22,13 +22,13 @@ export default class TextIconButton extends PureComponent { return ( diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.jsx b/app/javascript/flavours/glitch/features/compose/components/upload.jsx index 91f649a131b596..ca0b32e52653d9 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/upload.jsx @@ -7,7 +7,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import Motion from '../../ui/util/optional_motion'; diff --git a/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx b/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx index 928446c728a10c..cda57d2d8513de 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx @@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import Motion from '../../ui/util/optional_motion'; diff --git a/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js b/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js index 87362a4af45412..f86f01bd97e38c 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { makeGetAccount } from 'flavours/glitch/selectors'; - +import { makeGetAccount } from '../../../selectors'; import AutosuggestAccount from '../components/autosuggest_account'; const makeMapStateToProps = () => { diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index e9724568cdbb95..adc68840b3ce74 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -2,24 +2,24 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; + import { changeCompose, + submitCompose, + clearComposeSuggestions, + fetchComposeSuggestions, + selectComposeSuggestion, changeComposeSpoilerText, changeComposeSpoilerness, changeComposeVisibility, - clearComposeSuggestions, - fetchComposeSuggestions, insertEmojiCompose, - selectComposeSuggestion, - submitCompose, uploadCompose, -} from 'flavours/glitch/actions/compose'; -import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; +} from '../../../actions/compose'; +import { changeLocalSetting } from '../../../actions/local_settings'; import { openModal, -} from 'flavours/glitch/actions/modal'; -import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; - +} from '../../../actions/modal'; import ComposeForm from '../components/compose_form'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js index c06c52c14e7456..a0e50029dfa303 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js @@ -2,9 +2,8 @@ import { Map as ImmutableMap } from 'immutable'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { useEmoji } from 'flavours/glitch/actions/emojis'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { useEmoji } from '../../../actions/emojis'; +import { changeSetting } from '../../../actions/settings'; import EmojiPickerDropdown from '../components/emoji_picker_dropdown'; const perLine = 8; diff --git a/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js b/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js index 541365aa99f8da..459fffd9107463 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js @@ -3,9 +3,9 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { openModal } from 'flavours/glitch/actions/modal'; -import { me } from 'flavours/glitch/initial_state'; import { logOut } from 'flavours/glitch/utils/log_out'; +import { me } from '../../../initial_state'; import NavigationBar from '../components/navigation_bar'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js index cc8f341a3af00f..177ffcea6acb4b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js @@ -8,8 +8,7 @@ import { clearComposeSuggestions, fetchComposeSuggestions, selectComposeSuggestion, -} from 'flavours/glitch/actions/compose'; - +} from '../../../actions/compose'; import PollForm from '../components/poll_form'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js b/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js index dcbd977daed37a..6d26abf4f6623b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js @@ -1,9 +1,8 @@ import { connect } from 'react-redux'; -import { changeComposeVisibility } from 'flavours/glitch/actions/compose'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; -import { isUserTouching } from 'flavours/glitch/is_mobile'; - +import { changeComposeVisibility } from '../../../actions/compose'; +import { openModal, closeModal } from '../../../actions/modal'; +import { isUserTouching } from '../../../is_mobile'; import PrivacyDropdown from '../components/privacy_dropdown'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js index 61012bcb1e73d5..678124b2a8d93c 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { cancelReplyCompose } from 'flavours/glitch/actions/compose'; - +import { cancelReplyCompose } from '../../../actions/compose'; import ReplyIndicator from '../components/reply_indicator'; const makeMapStateToProps = () => { diff --git a/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx index 931f396b351b91..5a57332dd9336b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx +++ b/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx @@ -62,8 +62,6 @@ class SensitiveButton extends PureComponent { disabled={disabled} /> - - ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx index 16916ba9c03791..f339ccdfbfaf1f 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx @@ -10,7 +10,6 @@ import { HASHTAG_PATTERN_REGEX } from 'flavours/glitch/utils/hashtags'; import Warning from '../components/warning'; - const mapStateToProps = state => ({ needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']), hashtagWarning: state.getIn(['compose', 'privacy']) !== 'public' && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])), diff --git a/app/javascript/flavours/glitch/features/compose/index.jsx b/app/javascript/flavours/glitch/features/compose/index.jsx index 39ef19ef596834..86d5f31485e476 100644 --- a/app/javascript/flavours/glitch/features/compose/index.jsx +++ b/app/javascript/flavours/glitch/features/compose/index.jsx @@ -12,8 +12,8 @@ import spring from 'react-motion/lib/spring'; import { mountCompose, unmountCompose, cycleElefriendCompose } from 'flavours/glitch/actions/compose'; import Column from 'flavours/glitch/components/column'; -import { mascot } from 'flavours/glitch/initial_state'; +import { mascot } from '../../initial_state'; import Motion from '../ui/util/optional_motion'; import ComposeFormContainer from './containers/compose_form_container'; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx index 03e523bfd643d6..8c12ea9e5f68a2 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx @@ -5,8 +5,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { debounce } from 'lodash'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; - +import ScrollableList from '../../../components/scrollable_list'; import ConversationContainer from '../containers/conversation_container'; export default class ConversationsList extends ImmutablePureComponent { diff --git a/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js b/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js index d0298c7233e77c..1dcd3ec1bd4ad3 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { expandConversations } from 'flavours/glitch/actions/conversations'; - +import { expandConversations } from '../../../actions/conversations'; import ConversationsList from '../components/conversations_list'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx index c492552c022f74..9e63b2f8170570 100644 --- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx @@ -10,18 +10,13 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; - import { fetchDomainBlocks, expandDomainBlocks } from '../../actions/domain_blocks'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; import DomainContainer from '../../containers/domain_container'; import Column from '../ui/components/column'; - - - - const messages = defineMessages({ heading: { id: 'column.domain_blocks', defaultMessage: 'Blocked domains' }, unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' }, @@ -38,7 +33,7 @@ class Blocks extends ImmutablePureComponent { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, hasMore: PropTypes.bool, - domains: ImmutablePropTypes.list, + domains: ImmutablePropTypes.orderedSet, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, }; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji.js b/app/javascript/flavours/glitch/features/emoji/emoji.js index b50447d40614e9..1e6aae2394fde6 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji.js @@ -1,8 +1,9 @@ import Trie from 'substring-trie'; -import { autoPlayGif, useSystemEmojiFont } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; +import { autoPlayGif, useSystemEmojiFont } from '../../initial_state'; + import { unicodeMapping } from './emoji_unicode_mapping_light'; const trie = new Trie(Object.keys(unicodeMapping)); @@ -137,7 +138,6 @@ const emojify = (str, customEmojis = {}) => { }; export default emojify; -export { unicodeMapping }; export const buildCustomEmojis = (customEmojis) => { const emojis = []; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js index 6af8a93e5407f5..70ac5e176f9420 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js @@ -93,7 +93,7 @@ Object.keys(emojiIndex.emojis).forEach(key => { let { short_names, search, unified } = emojiMartData.emojis[key]; if (short_names[0] !== key) { - throw new Error('The compresser expects the first short_code to be the ' + + throw new Error('The compressor expects the first short_code to be the ' + 'key. It may need to be rewritten if the emoji change such that this ' + 'is no longer the case.'); } diff --git a/app/javascript/flavours/glitch/features/explore/components/story.jsx b/app/javascript/flavours/glitch/features/explore/components/story.jsx index 8dc92a4d91168c..0e5ab9212201bf 100644 --- a/app/javascript/flavours/glitch/features/explore/components/story.jsx +++ b/app/javascript/flavours/glitch/features/explore/components/story.jsx @@ -11,7 +11,6 @@ import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp import { ShortNumber } from 'flavours/glitch/components/short_number'; import { Skeleton } from 'flavours/glitch/components/skeleton'; - export default class Story extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/explore/index.jsx b/app/javascript/flavours/glitch/features/explore/index.jsx index f5baeb4b49f6b3..27c544af0ff65e 100644 --- a/app/javascript/flavours/glitch/features/explore/index.jsx +++ b/app/javascript/flavours/glitch/features/explore/index.jsx @@ -19,8 +19,6 @@ import Statuses from './statuses'; import Suggestions from './suggestions'; import Tags from './tags'; - - const messages = defineMessages({ title: { id: 'explore.title', defaultMessage: 'Explore' }, searchResults: { id: 'explore.search_results', defaultMessage: 'Search results' }, diff --git a/app/javascript/flavours/glitch/features/explore/tags.jsx b/app/javascript/flavours/glitch/features/explore/tags.jsx index bebc9bbb53b5fb..5f88a79eb60199 100644 --- a/app/javascript/flavours/glitch/features/explore/tags.jsx +++ b/app/javascript/flavours/glitch/features/explore/tags.jsx @@ -14,8 +14,6 @@ import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag' import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; - - const mapStateToProps = state => ({ hashtags: state.getIn(['trends', 'tags', 'items']), isLoadingHashtags: state.getIn(['trends', 'tags', 'isLoading']), diff --git a/app/javascript/flavours/glitch/features/favourites/index.jsx b/app/javascript/flavours/glitch/features/favourites/index.jsx index 49fd62b9664be2..ef24b7c79faa9a 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.jsx +++ b/app/javascript/flavours/glitch/features/favourites/index.jsx @@ -12,13 +12,12 @@ import { debounce } from 'lodash'; import { fetchFavourites, expandFavourites } from 'flavours/glitch/actions/interactions'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import ScrollableList from 'flavours/glitch/components/scrollable_list'; import AccountContainer from 'flavours/glitch/containers/account_container'; import Column from 'flavours/glitch/features/ui/components/column'; - const messages = defineMessages({ heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' }, refresh: { id: 'refresh', defaultMessage: 'Refresh' }, diff --git a/app/javascript/flavours/glitch/features/filters/select_filter.jsx b/app/javascript/flavours/glitch/features/filters/select_filter.jsx index bae1d9ef95b803..de74fb240b4441 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.jsx +++ b/app/javascript/flavours/glitch/features/filters/select_filter.jsx @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import fuzzysort from 'fuzzysort'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { toServerSideType } from 'flavours/glitch/utils/filters'; import { loupeIcon, deleteIcon } from 'flavours/glitch/utils/icons'; diff --git a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx index 1f665c049684b1..54a75dca706ce8 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx @@ -5,10 +5,10 @@ import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import Permalink from 'flavours/glitch/components/permalink'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import { IconButton } from '../../../components/icon_button'; +import Permalink from '../../../components/permalink'; const messages = defineMessages({ authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' }, diff --git a/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js b/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js index 854ebaecb8e5f5..c9c8dd7d874d13 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js +++ b/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts'; -import { makeGetAccount } from 'flavours/glitch/selectors'; - +import { authorizeFollowRequest, rejectFollowRequest } from '../../../actions/accounts'; +import { makeGetAccount } from '../../../selectors'; import AccountAuthorize from '../components/account_authorize'; const makeMapStateToProps = () => { diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.jsx b/app/javascript/flavours/glitch/features/follow_requests/index.jsx index 70a2ac1e42c573..f5ff56d98e9882 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/index.jsx @@ -10,19 +10,14 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchFollowRequests, expandFollowRequests } from 'flavours/glitch/actions/accounts'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import Column from 'flavours/glitch/features/ui/components/column'; -import { me } from 'flavours/glitch/initial_state'; +import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import ScrollableList from '../../components/scrollable_list'; +import { me } from '../../initial_state'; +import Column from '../ui/components/column'; import AccountAuthorizeContainer from './containers/account_authorize_container'; - - - - - const messages = defineMessages({ heading: { id: 'column.follow_requests', defaultMessage: 'Follow requests' }, }); @@ -74,7 +69,6 @@ class FollowRequests extends ImmutablePureComponent { return ( - { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); diff --git a/app/javascript/flavours/glitch/features/following/index.jsx b/app/javascript/flavours/glitch/features/following/index.jsx index 498aa4fbe5db3c..4ff59f635877ce 100644 --- a/app/javascript/flavours/glitch/features/following/index.jsx +++ b/app/javascript/flavours/glitch/features/following/index.jsx @@ -8,24 +8,24 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { - lookupAccount, - fetchAccount, - fetchFollowing, - expandFollowing, -} from 'flavours/glitch/actions/accounts'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; import { TimelineHint } from 'flavours/glitch/components/timeline_hint'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; -import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import Column from 'flavours/glitch/features/ui/components/column'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { getAccountHidden } from 'flavours/glitch/selectors'; +import { + lookupAccount, + fetchAccount, + fetchFollowing, + expandFollowing, +} from '../../actions/accounts'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import ProfileColumnHeader from '../account/components/profile_column_header'; import LimitedAccountHint from '../account_timeline/components/limited_account_hint'; +import HeaderContainer from '../account_timeline/containers/header_container'; +import Column from '../ui/components/column'; const mapStateToProps = (state, { params: { acct, id } }) => { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx index 31e3ceec7cb587..5d1a518ccb2663 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx @@ -14,7 +14,7 @@ import spring from 'react-motion/lib/spring'; import ReactSwipeableViews from 'react-swipeable-views'; import { AnimatedNumber } from 'flavours/glitch/components/animated_number'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import EmojiPickerDropdown from 'flavours/glitch/features/compose/containers/emoji_picker_dropdown_container'; import { unicodeMapping } from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; diff --git a/app/javascript/flavours/glitch/features/getting_started/index.jsx b/app/javascript/flavours/glitch/features/getting_started/index.jsx index 0987ad935205ae..e803c4949ccb5a 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/index.jsx @@ -14,17 +14,16 @@ import { fetchFollowRequests } from 'flavours/glitch/actions/accounts'; import { fetchLists } from 'flavours/glitch/actions/lists'; import { openModal } from 'flavours/glitch/actions/modal'; import Column from 'flavours/glitch/features/ui/components/column'; -import ColumnLink from 'flavours/glitch/features/ui/components/column_link'; -import ColumnSubheading from 'flavours/glitch/features/ui/components/column_subheading'; import LinkFooter from 'flavours/glitch/features/ui/components/link_footer'; -import { me, showTrends } from 'flavours/glitch/initial_state'; import { preferencesLink } from 'flavours/glitch/utils/backend_links'; +import { me, showTrends } from '../../initial_state'; import NavigationBar from '../compose/components/navigation_bar'; +import ColumnLink from '../ui/components/column_link'; +import ColumnSubheading from '../ui/components/column_subheading'; import TrendsContainer from './containers/trends_container'; - const messages = defineMessages({ heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js index 6e67d1fce4b6dd..be95004cc7bfaf 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import api from 'flavours/glitch/api'; - +import { changeColumnParams } from '../../../actions/columns'; +import api from '../../../api'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx b/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx index 675c4cc022520b..b2bf169da86bb9 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx @@ -16,7 +16,8 @@ import { fetchHashtag, followHashtag, unfollowHashtag } from 'flavours/glitch/ac import { expandHashtagTimeline, clearTimeline } from 'flavours/glitch/actions/timelines'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; + +import StatusListContainer from '../ui/containers/status_list_container'; import { HashtagHeader } from './components/hashtag_header'; import ColumnSettingsContainer from './containers/column_settings_container'; diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx index ce5219e3526696..7cdd58a12a118f 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx +++ b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx @@ -12,7 +12,7 @@ import { throttle, escapeRegExp } from 'lodash'; import { openModal, closeModal } from 'flavours/glitch/actions/modal'; import api from 'flavours/glitch/api'; import { Button } from 'flavours/glitch/components/button'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state'; const messages = defineMessages({ @@ -34,7 +34,7 @@ const mapDispatchToProps = (dispatch) => ({ }, }); -const PERSISTENCE_KEY = 'flavours/glitch_home'; +const PERSISTENCE_KEY = 'mastodon_home'; const isValidDomain = value => { const url = new URL('https:///path'); diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx index c12368ac098e2f..da5d334245becf 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx @@ -10,7 +10,6 @@ import { connect } from 'react-redux'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; - const messages = defineMessages({ heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' }, }); diff --git a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx b/app/javascript/flavours/glitch/features/list_adder/components/account.jsx index 4dc9c1f8933dea..31a2e963795e12 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx +++ b/app/javascript/flavours/glitch/features/list_adder/components/account.jsx @@ -8,7 +8,6 @@ import { Avatar } from '../../../components/avatar'; import { DisplayName } from '../../../components/display_name'; import { makeGetAccount } from '../../../selectors'; - const makeMapStateToProps = () => { const getAccount = makeGetAccount(); @@ -19,7 +18,6 @@ const makeMapStateToProps = () => { return mapStateToProps; }; - class Account extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx index 83a5ecb91fe9ee..f99958fd273933 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx +++ b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx @@ -6,10 +6,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { removeFromListAdder, addToListAdder } from '../../../actions/lists'; -import { IconButton } from '../../../components/icon_button'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/account.jsx b/app/javascript/flavours/glitch/features/list_editor/components/account.jsx index 01c044415314e8..91a2bdb79ddfb5 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/account.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/account.jsx @@ -5,10 +5,9 @@ import { defineMessages } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { IconButton } from 'flavours/glitch/components/icon_button'; - +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx index 5c4fff27b5e6b1..9e087a97d714d9 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx @@ -5,8 +5,8 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists'; -import { IconButton } from 'flavours/glitch/components/icon_button'; +import { changeListEditorTitle, submitListEditor } from '../../../actions/lists'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ title: { id: 'lists.edit.submit', defaultMessage: 'Change title' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx index a43b3b969ef1c5..43c0358ba6e458 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx @@ -5,7 +5,7 @@ import { defineMessages } from 'react-intl'; import classNames from 'classnames'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; const messages = defineMessages({ search: { id: 'lists.search', defaultMessage: 'Search among people you follow' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/index.jsx b/app/javascript/flavours/glitch/features/list_editor/index.jsx index 134d5ff074e7a3..dca690a3ec6976 100644 --- a/app/javascript/flavours/glitch/features/list_editor/index.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/index.jsx @@ -8,8 +8,7 @@ import { connect } from 'react-redux'; import spring from 'react-motion/lib/spring'; -import { setupListEditor, clearListSuggestions, resetListEditor } from 'flavours/glitch/actions/lists'; - +import { setupListEditor, clearListSuggestions, resetListEditor } from '../../actions/lists'; import Motion from '../ui/util/optional_motion'; import EditListForm from './components/edit_list_form'; diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx index 594cecaf74a5af..b7c80b167146f7 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/list_timeline/index.jsx @@ -18,7 +18,7 @@ import { connectListStream } from 'flavours/glitch/actions/streaming'; import { expandListTimeline } from 'flavours/glitch/actions/timelines'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import { RadioButton } from 'flavours/glitch/components/radio_button'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; diff --git a/app/javascript/flavours/glitch/features/mutes/index.jsx b/app/javascript/flavours/glitch/features/mutes/index.jsx index b3c2ed38b07d6a..f9c42378a58ee5 100644 --- a/app/javascript/flavours/glitch/features/mutes/index.jsx +++ b/app/javascript/flavours/glitch/features/mutes/index.jsx @@ -10,15 +10,12 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchMutes, expandMutes } from 'flavours/glitch/actions/mutes'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; - - - +import { fetchMutes, expandMutes } from '../../actions/mutes'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.mutes', defaultMessage: 'Muted users' }, @@ -51,7 +48,7 @@ class Mutes extends ImmutablePureComponent { }, 300, { leading: true }); render () { - const { intl, accountIds, hasMore, multiColumn, isLoading } = this.props; + const { intl, hasMore, accountIds, multiColumn, isLoading } = this.props; if (!accountIds) { return ( diff --git a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx index 0833ac29d7ad8d..c75bdf8ad49355 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx @@ -3,7 +3,7 @@ import { Component } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; export default class ClearColumnButton extends Component { diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx index 0e8127e3620290..de1e1b9519fe8a 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; const tooltips = defineMessages({ mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' }, diff --git a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx index 25d71467d31225..53bf1747a15dd0 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx @@ -8,11 +8,9 @@ import { connect } from 'react-redux'; import { requestBrowserPermission } from 'flavours/glitch/actions/notifications'; import { changeSetting } from 'flavours/glitch/actions/settings'; import { Button } from 'flavours/glitch/components/button'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; - - const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); diff --git a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js index cc3793fcccee86..b63796a8b285c4 100644 --- a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js @@ -2,12 +2,11 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { showAlert } from 'flavours/glitch/actions/alerts'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { setFilter, clearNotifications, requestBrowserPermission } from 'flavours/glitch/actions/notifications'; -import { changeAlerts as changePushNotifications } from 'flavours/glitch/actions/push_notifications'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { showAlert } from '../../../actions/alerts'; +import { openModal } from '../../../actions/modal'; +import { setFilter, clearNotifications, requestBrowserPermission } from '../../../actions/notifications'; +import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/notifications/index.jsx b/app/javascript/flavours/glitch/features/notifications/index.jsx index d84d29f112191b..6d42f27697f49c 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.jsx +++ b/app/javascript/flavours/glitch/features/notifications/index.jsx @@ -13,8 +13,12 @@ import { createSelector } from 'reselect'; import { debounce } from 'lodash'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { submitMarkers } from 'flavours/glitch/actions/markers'; +import { compareId } from 'flavours/glitch/compare_id'; +import { Icon } from 'flavours/glitch/components/icon'; +import { NotSignedInIndicator } from 'flavours/glitch/components/not_signed_in_indicator'; + +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { submitMarkers } from '../../actions/markers'; import { enterNotificationClearingMode, expandNotifications, @@ -23,26 +27,18 @@ import { mountNotifications, unmountNotifications, markNotificationsAsRead, -} from 'flavours/glitch/actions/notifications'; -import { compareId } from 'flavours/glitch/compare_id'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; -import { LoadGap } from 'flavours/glitch/components/load_gap'; -import { NotSignedInIndicator } from 'flavours/glitch/components/not_signed_in_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import NotificationPurgeButtonsContainer from 'flavours/glitch/containers/notification_purge_buttons_container'; +} from '../../actions/notifications'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import { LoadGap } from '../../components/load_gap'; +import ScrollableList from '../../components/scrollable_list'; +import NotificationPurgeButtonsContainer from '../../containers/notification_purge_buttons_container'; import NotificationsPermissionBanner from './components/notifications_permission_banner'; import ColumnSettingsContainer from './containers/column_settings_container'; import FilterBarContainer from './containers/filter_bar_container'; import NotificationContainer from './containers/notification_container'; - - - - - const messages = defineMessages({ title: { id: 'column.notifications', defaultMessage: 'Notifications' }, enterNotifCleaning : { id: 'notification_purge.start', defaultMessage: 'Enter notification cleaning mode' }, diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx index d58d77d7abc17b..7a2902bbf07128 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx @@ -12,8 +12,6 @@ import { Avatar } from 'flavours/glitch/components/avatar'; import { DisplayName } from 'flavours/glitch/components/display_name'; import { IconButton } from 'flavours/glitch/components/icon_button'; - - const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); diff --git a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx index 2d083a90ecb690..82684c83685439 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx @@ -5,8 +5,8 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import SettingText from 'flavours/glitch/components/setting_text'; -import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle'; +import SettingText from '../../../components/setting_text'; +import SettingToggle from '../../notifications/components/setting_toggle'; const messages = defineMessages({ filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, diff --git a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js index b884f15f5fdfea..6476d51ffbf25e 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { changeColumnParams } from '../../../actions/columns'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.jsx b/app/javascript/flavours/glitch/features/public_timeline/index.jsx index dc5d53f9d490a4..8c373d99ab2820 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/public_timeline/index.jsx @@ -7,15 +7,16 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { connectPublicStream } from 'flavours/glitch/actions/streaming'; -import { expandPublicTimeline } from 'flavours/glitch/actions/timelines'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import { domain } from 'flavours/glitch/initial_state'; +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { connectPublicStream } from '../../actions/streaming'; +import { expandPublicTimeline } from '../../actions/timelines'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import StatusListContainer from '../ui/containers/status_list_container'; + import ColumnSettingsContainer from './containers/column_settings_container'; const messages = defineMessages({ @@ -43,14 +44,14 @@ const mapStateToProps = (state, { columnId }) => { class PublicTimeline extends PureComponent { - static defaultProps = { - onlyMedia: false, - }; - static contextTypes = { identity: PropTypes.object, }; + static defaultProps = { + onlyMedia: false, + }; + static propTypes = { dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, diff --git a/app/javascript/flavours/glitch/features/reblogs/index.jsx b/app/javascript/flavours/glitch/features/reblogs/index.jsx index 8cc4c004f0e75d..9e656f485226aa 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.jsx +++ b/app/javascript/flavours/glitch/features/reblogs/index.jsx @@ -10,13 +10,14 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchReblogs, expandReblogs } from 'flavours/glitch/actions/interactions'; -import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; +import { Icon } from 'flavours/glitch/components/icon'; + +import { fetchReblogs, expandReblogs } from '../../actions/interactions'; +import ColumnHeader from '../../components/column_header'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.reblogged_by', defaultMessage: 'Boosted by' }, diff --git a/app/javascript/flavours/glitch/features/report/statuses.jsx b/app/javascript/flavours/glitch/features/report/statuses.jsx index 181b561625ff2e..192f6b216b865b 100644 --- a/app/javascript/flavours/glitch/features/report/statuses.jsx +++ b/app/javascript/flavours/glitch/features/report/statuses.jsx @@ -11,7 +11,6 @@ import { Button } from 'flavours/glitch/components/button'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import StatusCheckBox from 'flavours/glitch/features/report/containers/status_check_box_container'; - const mapStateToProps = (state, { accountId }) => ({ availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])), isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']), diff --git a/app/javascript/flavours/glitch/features/standalone/compose/index.jsx b/app/javascript/flavours/glitch/features/standalone/compose/index.jsx index 8ffd98d4ec7ae7..c36e843f5ada65 100644 --- a/app/javascript/flavours/glitch/features/standalone/compose/index.jsx +++ b/app/javascript/flavours/glitch/features/standalone/compose/index.jsx @@ -1,9 +1,9 @@ import { PureComponent } from 'react'; -import ComposeFormContainer from 'flavours/glitch/features/compose/containers/compose_form_container'; -import LoadingBarContainer from 'flavours/glitch/features/ui/containers/loading_bar_container'; -import ModalContainer from 'flavours/glitch/features/ui/containers/modal_container'; -import NotificationsContainer from 'flavours/glitch/features/ui/containers/notifications_container'; +import ComposeFormContainer from '../../compose/containers/compose_form_container'; +import LoadingBarContainer from '../../ui/containers/loading_bar_container'; +import ModalContainer from '../../ui/containers/modal_container'; +import NotificationsContainer from '../../ui/containers/notifications_container'; export default class Compose extends PureComponent { diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx index 7014c7a7fa478f..a0efad1baafa33 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx @@ -8,14 +8,15 @@ import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container'; -import { me, maxReactions } from 'flavours/glitch/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions'; import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links'; import EmojiPickerDropdown from '../../compose/containers/emoji_picker_dropdown_container'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { IconButton } from '../../../components/icon_button'; +import DropdownMenuContainer from '../../../containers/dropdown_menu_container'; +import { me, maxReactions } from '../../../initial_state'; + const messages = defineMessages({ delete: { id: 'status.delete', defaultMessage: 'Delete' }, redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' }, diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx index 9631a0b64a81c2..1968f2c937c417 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx @@ -10,21 +10,22 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { AnimatedNumber } from 'flavours/glitch/components/animated_number'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; import EditedTimestamp from 'flavours/glitch/components/edited_timestamp'; +import { getHashtagBarForStatus } from 'flavours/glitch/components/hashtag_bar'; import { Icon } from 'flavours/glitch/components/icon'; -import MediaGallery from 'flavours/glitch/components/media_gallery'; import PictureInPicturePlaceholder from 'flavours/glitch/components/picture_in_picture_placeholder'; -import StatusContent from 'flavours/glitch/components/status_content'; -import StatusReactions from 'flavours/glitch/components/status_reactions'; import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; import PollContainer from 'flavours/glitch/containers/poll_container'; -import Audio from 'flavours/glitch/features/audio'; -import Video from 'flavours/glitch/features/video'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import MediaGallery from '../../../components/media_gallery'; +import StatusContent from '../../../components/status_content'; +import StatusReactions from '../../../components/status_reactions'; +import Audio from '../../audio'; import scheduleIdleTask from '../../ui/util/schedule_idle_task'; +import Video from '../../video'; import Card from './card'; @@ -310,6 +311,9 @@ class DetailedStatus extends ImmutablePureComponent { ); } + const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); + contentMedia.push(hashtagBar); + return (
@@ -332,6 +336,7 @@ class DetailedStatus extends ImmutablePureComponent { tagLinks={settings.get('tag_misleading_links')} rewriteMentions={settings.get('rewrite_mentions')} disabled + {...statusContentProps} /> { const getAccount = makeGetAccount(); diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx index be78bb1f580a6f..db02e5269079ec 100644 --- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx @@ -11,16 +11,17 @@ import { connect } from 'react-redux'; import { changeBoostPrivacy } from 'flavours/glitch/actions/boosts'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { Button } from 'flavours/glitch/components/button'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { Icon } from 'flavours/glitch/components/icon'; -import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; -import StatusContent from 'flavours/glitch/components/status_content'; +import { Icon } from 'flavours/glitch/components/icon'; import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; import PrivacyDropdown from 'flavours/glitch/features/compose/components/privacy_dropdown'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { Avatar } from '../../../components/avatar'; +import { Button } from '../../../components/button'; +import { DisplayName } from '../../../components/display_name'; +import { RelativeTimestamp } from '../../../components/relative_timestamp'; +import StatusContent from '../../../components/status_content'; + const messages = defineMessages({ cancel_reblog: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx index de432064811ad0..1d792a2cfe8f2f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx @@ -3,7 +3,7 @@ import { Component } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; -import { IconButton } from 'flavours/glitch/components/icon_button'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ error: { id: 'bundle_modal_error.message', defaultMessage: 'Something went wrong while loading this component.' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/column.jsx b/app/javascript/flavours/glitch/features/ui/components/column.jsx index 8f6259e5b76ea9..6e8ff93e190f3b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/column.jsx @@ -3,8 +3,8 @@ import { PureComponent } from 'react'; import { debounce } from 'lodash'; -import { isMobile } from 'flavours/glitch/is_mobile'; -import { scrollTop } from 'flavours/glitch/scroll'; +import { isMobile } from '../../../is_mobile'; +import { scrollTop } from '../../../scroll'; import ColumnHeader from './column_header'; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_header.jsx b/app/javascript/flavours/glitch/features/ui/components/column_header.jsx index a2934e60f19d73..c24ab898c95deb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_header.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/column_header.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import classNames from 'classnames'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; export default class ColumnHeader extends PureComponent { diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx b/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx index 98303ef2d5b13d..f1e7baf8dd59ef 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx @@ -6,8 +6,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { supportsPassiveEvents } from 'detect-passive-events'; -import { scrollRight } from 'flavours/glitch/scroll'; - +import { scrollRight } from '../../../scroll'; import BundleContainer from '../containers/bundle_container'; import { Compose, diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx index 1b92ac398f3047..3f9ba99e4ffb9c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx @@ -11,7 +11,6 @@ import SearchContainer from 'flavours/glitch/features/compose/containers/search_ import LinkFooter from './link_footer'; - class ComposePanel extends PureComponent { static contextTypes = { diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx index c7b4c736c8131e..59913b4bdb3807 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { injectIntl, FormattedMessage } from 'react-intl'; -import { Button } from 'flavours/glitch/components/button'; +import { Button } from '../../../components/button'; class ConfirmationModal extends PureComponent { diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx index 31d5e42a68baff..ec306e3517edd4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx @@ -23,11 +23,11 @@ import Audio from 'flavours/glitch/features/audio'; import CharacterCounter from 'flavours/glitch/features/compose/components/character_counter'; import UploadProgress from 'flavours/glitch/features/compose/components/upload_progress'; import { Tesseract as fetchTesseract } from 'flavours/glitch/features/ui/util/async-components'; -import Video, { getPointerPosition } from 'flavours/glitch/features/video'; import { me } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; import { changeUploadCompose, uploadThumbnail, onChangeMediaDescription, onChangeMediaFocus } from '../../../actions/compose'; +import Video, { getPointerPosition } from '../../video'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx index 29821c388ffe21..d3d74136f10128 100644 --- a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx @@ -11,7 +11,7 @@ import ReactSwipeableViews from 'react-swipeable-views'; import { getAverageFromBlurhash } from 'flavours/glitch/blurhash'; import { GIFV } from 'flavours/glitch/components/gifv'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Footer from 'flavours/glitch/features/picture_in_picture/components/footer'; import Video from 'flavours/glitch/features/video'; diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx b/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx index 3206e06c6affbb..7d19e73513336d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx @@ -1,4 +1,4 @@ -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; +import { LoadingIndicator } from '../../../components/loading_indicator'; // Keep the markup in sync with // (make sure they have the same dimensions) diff --git a/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx index fc72355109a425..2d95cabef84db1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx @@ -7,10 +7,10 @@ import { connect } from 'react-redux'; import Toggle from 'react-toggle'; -import { muteAccount } from 'flavours/glitch/actions/accounts'; -import { closeModal } from 'flavours/glitch/actions/modal'; -import { toggleHideNotifications, changeMuteDuration } from 'flavours/glitch/actions/mutes'; -import { Button } from 'flavours/glitch/components/button'; +import { muteAccount } from '../../../actions/accounts'; +import { closeModal } from '../../../actions/modal'; +import { toggleHideNotifications, changeMuteDuration } from '../../../actions/mutes'; +import { Button } from '../../../components/button'; const messages = defineMessages({ minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx index f42fdf8f5ebac1..7b47e08234d44f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx @@ -65,7 +65,11 @@ class NavigationPanel extends Component { return (
- {banner} + {banner && + + } {signedIn && ( <> diff --git a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx index 184a8d103ff304..5db3cb492bb6f1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; + import { openModal } from 'flavours/glitch/actions/modal'; import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state'; import { useAppDispatch, useAppSelector } from 'flavours/glitch/store'; diff --git a/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx b/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx index 621f8c22779ab4..9aa8e359f8938d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx @@ -7,8 +7,6 @@ import spring from 'react-motion/lib/spring'; import Motion from '../util/optional_motion'; - - export default class UploadArea extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js b/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js index ff5a35319e6441..6a476fe2483cf3 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js @@ -1,10 +1,8 @@ import { connect } from 'react-redux'; -import { fetchBundleRequest, fetchBundleSuccess, fetchBundleFail } from 'flavours/glitch/actions/bundles'; - +import { fetchBundleRequest, fetchBundleSuccess, fetchBundleFail } from '../../../actions/bundles'; import Bundle from '../components/bundle'; - const mapDispatchToProps = dispatch => ({ onFetch () { dispatch(fetchBundleRequest()); diff --git a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js index 0d07d68a5d1ce2..1c3872cd50436f 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; - +import { openModal, closeModal } from '../../../actions/modal'; import ModalRoot from '../components/modal_root'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js b/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js index 42a55a4b80ac2b..c1d19f710085d7 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js @@ -4,8 +4,8 @@ import { connect } from 'react-redux'; import { NotificationStack } from 'react-notification'; -import { dismissAlert } from 'flavours/glitch/actions/alerts'; -import { getAlerts } from 'flavours/glitch/selectors'; +import { dismissAlert } from '../../../actions/alerts'; +import { getAlerts } from '../../../selectors'; const mapStateToProps = (state, { intl }) => { const notifications = getAlerts(state); diff --git a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js index 5f34f5cd2e3304..f34d099b24015f 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js @@ -4,9 +4,9 @@ import { createSelector } from 'reselect'; import { debounce } from 'lodash'; -import { scrollTopTimeline, loadPending } from 'flavours/glitch/actions/timelines'; -import StatusList from 'flavours/glitch/components/status_list'; -import { me } from 'flavours/glitch/initial_state'; +import { scrollTopTimeline, loadPending } from '../../../actions/timelines'; +import StatusList from '../../../components/status_list'; +import { me } from '../../../initial_state'; const getRegex = createSelector([ (state, { regex }) => regex, diff --git a/app/javascript/flavours/glitch/features/ui/index.jsx b/app/javascript/flavours/glitch/features/ui/index.jsx index 35b2a6db4e4817..566421e65cb23b 100644 --- a/app/javascript/flavours/glitch/features/ui/index.jsx +++ b/app/javascript/flavours/glitch/features/ui/index.jsx @@ -13,17 +13,17 @@ import { debounce } from 'lodash'; import { HotKeys } from 'react-hotkeys'; import { changeLayout } from 'flavours/glitch/actions/app'; -import { uploadCompose, resetCompose, changeComposeSpoilerness } from 'flavours/glitch/actions/compose'; -import { clearHeight } from 'flavours/glitch/actions/height_cache'; import { synchronouslySubmitMarkers, submitMarkers, fetchMarkers } from 'flavours/glitch/actions/markers'; -import { expandNotifications, notificationsSetVisibility } from 'flavours/glitch/actions/notifications'; -import { fetchServer, fetchServerTranslationLanguages } from 'flavours/glitch/actions/server'; -import { expandHomeTimeline } from 'flavours/glitch/actions/timelines'; import PermaLink from 'flavours/glitch/components/permalink'; import PictureInPicture from 'flavours/glitch/features/picture_in_picture'; import { layoutFromWindow } from 'flavours/glitch/is_mobile'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../actions/compose'; +import { clearHeight } from '../../actions/height_cache'; +import { expandNotifications, notificationsSetVisibility } from '../../actions/notifications'; +import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server'; +import { expandHomeTimeline } from '../../actions/timelines'; import initialState, { me, owner, singleUserMode, trendsEnabled, trendsAsLanding } from '../../initial_state'; import BundleColumnError from './components/bundle_column_error'; diff --git a/app/javascript/flavours/glitch/features/ui/util/optional_motion.js b/app/javascript/flavours/glitch/features/ui/util/optional_motion.js index 4ec687738493e3..0b6d4d97f7967f 100644 --- a/app/javascript/flavours/glitch/features/ui/util/optional_motion.js +++ b/app/javascript/flavours/glitch/features/ui/util/optional_motion.js @@ -1,6 +1,6 @@ import Motion from 'react-motion/lib/Motion'; -import { reduceMotion } from 'flavours/glitch/initial_state'; +import { reduceMotion } from '../../../initial_state'; import ReducedMotion from './reduced_motion'; diff --git a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx index 0847aa443534ac..c0ee31bf68041b 100644 --- a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx +++ b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx @@ -5,9 +5,9 @@ import { Switch, Route, useLocation } from 'react-router-dom'; import StackTrace from 'stacktrace-js'; -import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import ColumnLoading from 'flavours/glitch/features/ui/components/column_loading'; -import BundleContainer from 'flavours/glitch/features/ui/containers/bundle_container'; +import BundleColumnError from '../components/bundle_column_error'; +import ColumnLoading from '../components/column_loading'; +import BundleContainer from '../containers/bundle_container'; // Small wrapper to pass multiColumn to the route components export const WrappedSwitch = ({ multiColumn, children }) => { @@ -30,7 +30,7 @@ WrappedSwitch.propTypes = { children: PropTypes.node, }; -// Small Wraper to extract the params from the route and pass +// Small Wrapper to extract the params from the route and pass // them to the rendered component, together with the content to // be rendered inside (the children) export class WrappedRoute extends Component { diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx index 022f6626996d4e..2d50f3d8ebc9a2 100644 --- a/app/javascript/flavours/glitch/features/video/index.jsx +++ b/app/javascript/flavours/glitch/features/video/index.jsx @@ -10,9 +10,9 @@ import { is } from 'immutable'; import { throttle } from 'lodash'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { Icon } from 'flavours/glitch/components/icon'; -import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; +import { Icon } from 'flavours/glitch/components/icon'; +import { displayMedia, useBlurhash } from '../../initial_state'; import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/locales/cy.json b/app/javascript/flavours/glitch/locales/cy.json index f7b668e4e6d6e8..487d2c08eb37db 100644 --- a/app/javascript/flavours/glitch/locales/cy.json +++ b/app/javascript/flavours/glitch/locales/cy.json @@ -1,4 +1,46 @@ { + "about.fork_disclaimer": "Mae Glitch-Soc yn feddalwedd di-dal a ffynhonnell agored wedi'i fforchio o Mastodon.", + "account.add_account_note": "Ychwanegu nodyn ar @{name}", + "account.disclaimer_full": "Mae'n bosib nad yw'r gwybodaeth isod yn rhoi darlun cyfan o broffil y defnyddiwr.", + "account.follows": "Yn dilyn", + "account.joined": "Ymunodd ar {date}", + "account.mute_notifications": "Diffodd hysbysiadau o @{name}", + "account.suspended_disclaimer_full": "Mae'r defnyddiwr yma wedi'i atal gan gymedrolwr.", + "account.unmute_notifications": "Dad-dawelu hysbysiadau o @{name}", + "account.view_full_profile": "Dangos proffil cyfan", + "account_note.cancel": "Canslo", + "account_note.edit": "Golygu", + "account_note.glitch_placeholder": "Dim sylw wedi'i roi", + "account_note.save": "Cadw", + "advanced_options.icon_title": "Dewisiadau uwch", + "advanced_options.local-only.short": "Lleol yn unig", + "advanced_options.local-only.tooltip": "Mae'r post yma'n lleol yn unig", + "advanced_options.threaded_mode.short": "Modd edafau", + "advanced_options.threaded_mode.tooltip": "Modd edafau wedi'i alluogi", + "boost_modal.missing_description": "Mae'r tŵt yma'n cynnwys ychydig gyfryngau heb ddisgrifiad", + "column.favourited_by": "Wedi'i hoffi gan", + "column.heading": "Misg", + "column.reblogged_by": "Wedi'i bŵstio gan", + "column.subheading": "Opsiynnau arall", + "column_header.profile": "Proffil", + "column_subheading.lists": "Rhestri", + "column_subheading.navigation": "Llywio", + "community.column_settings.allow_local_only": "Dangos tŵtiau lleol yn unig", + "compose.attach": "Atodi...", + "compose.attach.doodle": "Darlinio rhywbeth", + "compose.attach.upload": "Uwchlwythio ffeil", + "compose.content-type.html": "HTML", + "compose.content-type.markdown": "Markdown", + "compose.content-type.plain": "Testun plaen", + "compose_form.poll.multiple_choices": "Caniatau sawl dewis", + "compose_form.poll.single_choice": "Caniatau un dewis", + "compose_form.spoiler": "Cuddio testun tu ôl rhybydd", + "confirmations.missing_media_description.confirm": "Anfon beth bynnag", + "confirmations.missing_media_description.edit": "Golygu cyfryngau", + "confirmations.unfilter.author": "Awdur", + "confirmations.unfilter.confirm": "Dangos", + "confirmations.unfilter.edit_filter": "Golygi hidlydd", + "content-type.change": "Math cynnwys", "empty_column.follow_recommendations": "Does dim awgrymiadau yma i chi. Gallwch geisio chwilio am bobl rydych yn eu hadnabod neu edrych drwy hashnodau sy'n trendio.", "follow_recommendations.done": "Wedi gorffen", "follow_recommendations.heading": "Dilynwch y bobl yr hoffech chi weld eu postiadau! Dyma ambell i awgrymiad.", diff --git a/app/javascript/flavours/glitch/locales/de.json b/app/javascript/flavours/glitch/locales/de.json index d0bb329ad324c7..a9ca2e9316129d 100644 --- a/app/javascript/flavours/glitch/locales/de.json +++ b/app/javascript/flavours/glitch/locales/de.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "Die folgenden Informationen könnten das Profil des Nutzers unvollständig wiedergeben.", "account.follows": "Folgt", "account.joined": "Beigetreten am {date}", + "account.mute_notifications": "Benachrichtigungen von @{name} stummschalten", "account.suspended_disclaimer_full": "Dieser Nutzer wurde durch einen Moderator gesperrt.", + "account.unmute_notifications": "Benachrichtigungen von @{name} nicht mehr stummschalten", "account.view_full_profile": "Vollständiges Profil anzeigen", "account_note.cancel": "Abbrechen", "account_note.edit": "Bearbeiten", @@ -47,9 +49,10 @@ "confirmations.unfilter.filters": "Passende{count, plural, one {r} other {}} Filter", "content-type.change": "Inhaltstyp", "direct.group_by_conversations": "Nach Unterhaltung gruppieren", - "empty_column.follow_recommendations": "Es sieht so aus, als könnten keine Vorschläge für dich generiert werden. Du kannst versuchen, nach Leuten zu suchen, die du vielleicht kennst, oder du kannst angesagte Hashtags erkunden.", + "empty_column.follow_recommendations": "Es sieht so aus, als könnten keine Vorschläge für dich generiert werden. Du kannst versuchen, nach Leuten, die du vielleicht kennst, oder du kannst angesagte Hashtags erkunden.", "endorsed_accounts_editor.endorsed_accounts": "Empfohlene Konten", "favourite_modal.combo": "Mit {combo} wird dieses Fenster beim nächsten Mal nicht mehr angezeigt", + "firehose.column_settings.allow_local_only": "Zeige \"nur Lokal\"-Beiträge in \"Alle\"", "follow_recommendations.done": "Fertig", "follow_recommendations.heading": "Folge Leuten, deren Beiträge du sehen möchtest! Hier sind einige Vorschläge.", "follow_recommendations.lead": "Beiträge von Leuten, denen du folgst, werden in chronologischer Reihenfolge auf deiner Startseite angezeigt. Sei unbesorgt, mal Fehler zu begehen. Du kannst Leuten jederzeit ganz einfach wieder entfolgen!", diff --git a/app/javascript/flavours/glitch/locales/es-MX.json b/app/javascript/flavours/glitch/locales/es-MX.json index 306a55c2df175c..7a8af6bed3db9d 100644 --- a/app/javascript/flavours/glitch/locales/es-MX.json +++ b/app/javascript/flavours/glitch/locales/es-MX.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "La información aquí presentada puede reflejar de manera incompleta el perfil del usuario.", "account.follows": "Seguir", "account.joined": "Unido {date}", + "account.mute_notifications": "Silenciar notificaciones de @{name}", "account.suspended_disclaimer_full": "Este usuario ha sido suspendido por un moderador.", + "account.unmute_notifications": "Dejar de silenciar notificaciones de @{name}", "account.view_full_profile": "Ver perfil completo", "account_note.cancel": "Cancelar", "account_note.edit": "Editar", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Parece que no se ha podido generar ninguna sugerencia para ti. Puedes probar a buscar a gente que quizá conozcas o explorar los hashtags que están en tendencia.", "endorsed_accounts_editor.endorsed_accounts": "Cuentas destacadas", "favourite_modal.combo": "Puedes presionar {combo} para omitir esto la próxima vez", + "firehose.column_settings.allow_local_only": "Mostrar mensajes solo-locales en \"Todo\"", "follow_recommendations.done": "Hecho", "follow_recommendations.heading": "¡Sigue a gente que publique cosas que te gusten! Aquí tienes algunas sugerencias.", "follow_recommendations.lead": "Las publicaciones de la gente a la que sigas aparecerán ordenadas cronológicamente en Inicio. No tengas miedo de cometer errores, ¡puedes dejarles de seguir en cualquier momento con la misma facilidad!", diff --git a/app/javascript/flavours/glitch/locales/es.json b/app/javascript/flavours/glitch/locales/es.json index 0dddbcb99dddc8..690747d3057173 100644 --- a/app/javascript/flavours/glitch/locales/es.json +++ b/app/javascript/flavours/glitch/locales/es.json @@ -1,10 +1,12 @@ { "about.fork_disclaimer": "Glitch-soc es software gratuito, de código abierto, bifurcado de Mastodon.", "account.add_account_note": "Añadir nota para @{name}", - "account.disclaimer_full": "La información aquí presentada puede reflejar de manera incompleta el perfil del usuario.", + "account.disclaimer_full": "La información que figura a continuación puede reflejar el perfil de la cuenta de forma incompleta.", "account.follows": "Sigue", - "account.joined": "Unido el {date}", + "account.joined": "Se unió el {date}", + "account.mute_notifications": "Silenciar notificaciones de @{name}", "account.suspended_disclaimer_full": "Este usuario ha sido suspendido por un moderador.", + "account.unmute_notifications": "Dejar de silenciar notificaciones de @{name}", "account.view_full_profile": "Ver perfil completo", "account_note.cancel": "Cancelar", "account_note.edit": "Editar", @@ -25,7 +27,7 @@ "column_header.profile": "Perfil", "column_subheading.lists": "Listas", "column_subheading.navigation": "Navegación", - "community.column_settings.allow_local_only": "Mostrar sólo toots locales", + "community.column_settings.allow_local_only": "Mostrar toots solo-locales", "compose.attach": "Adjuntar...", "compose.attach.doodle": "Dibujar algo", "compose.attach.upload": "Subir un archivo", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Parece que no se ha podido generar ninguna sugerencia para ti. Puedes probar a buscar a gente que quizá conozcas o explorar los hashtags que están en tendencia.", "endorsed_accounts_editor.endorsed_accounts": "Cuentas destacadas", "favourite_modal.combo": "Puedes presionar {combo} para omitir esto la próxima vez", + "firehose.column_settings.allow_local_only": "Mostrar mensajes solo-locales en \"Todo\"", "follow_recommendations.done": "Hecho", "follow_recommendations.heading": "¡Sigue a gente que publique cosas que te gusten! Aquí tienes algunas sugerencias.", "follow_recommendations.lead": "Las publicaciones de la gente a la que sigas aparecerán ordenadas cronológicamente en Inicio. No tengas miedo de cometer errores, ¡puedes dejarles de seguir en cualquier momento con la misma facilidad!", diff --git a/app/javascript/flavours/glitch/locales/nl.json b/app/javascript/flavours/glitch/locales/nl.json index 51a96814da08eb..fb3ca80e4ea634 100644 --- a/app/javascript/flavours/glitch/locales/nl.json +++ b/app/javascript/flavours/glitch/locales/nl.json @@ -1,10 +1,74 @@ { + "account.follows": "Volgers", + "account.joined": "Lid sinds {date}", + "account.mute_notifications": "Meldingen dempen van @{name}", + "account.unmute_notifications": "Meldingen van @{name} niet langer dempen", + "account.view_full_profile": "Volledig profiel weergeven", + "account_note.cancel": "Annuleer", + "account_note.edit": "Bewerk", + "account_note.glitch_placeholder": "Geen notitie toegevoegd", + "account_note.save": "Opslaan", + "advanced_options.icon_title": "Geavanceerde opties", + "advanced_options.local-only.long": "Niet naar andere instanties sturen", + "advanced_options.local-only.short": "Alleen lokaal", + "advanced_options.local-only.tooltip": "Dit bericht alleen lokaal", + "advanced_options.threaded_mode.short": "Thread modus", + "advanced_options.threaded_mode.tooltip": "Thread modus ingeschakeld", + "boost_modal.missing_description": "Deze toot bevat media zonder beschrijving", + "column.favourited_by": "Favoriet door", + "column.heading": "Overige", + "column.reblogged_by": "Geboost door", + "column.subheading": "Diverse opties", + "column_header.profile": "Profiel", + "column_subheading.lists": "Lijsten", + "column_subheading.navigation": "Navigatie", + "community.column_settings.allow_local_only": "Toon alleen lokale toots", + "compose.attach.doodle": "Teken iets", + "compose.attach.upload": "Bestand uploaden", + "compose.content-type.html": "HTML", + "compose.content-type.markdown": "Markdown", + "compose.content-type.plain": "Onopgemaakte tekst", + "compose_form.poll.multiple_choices": "Meerdere keuzes toestaan", + "compose_form.poll.single_choice": "Eén keuze toestaan", + "compose_form.spoiler": "Verberg tekst achter waarschuwing", + "confirmation_modal.do_not_ask_again": "Vraag niet meer om bevestiging", + "confirmations.deprecated_settings.confirm": "Gebruik voorkeuren van Mastodon", + "confirmations.missing_media_description.confirm": "Toch verzenden", + "confirmations.missing_media_description.edit": "Media bewerken", + "confirmations.missing_media_description.message": "Minstens één media-bijlage mist een beschrijving. Overweeg om alle mediabijlagen voor slechtzienden te beschrijven voordat u uw toot verstuurt.", + "confirmations.unfilter.author": "Auteur", + "confirmations.unfilter.confirm": "Weergeven", + "confirmations.unfilter.edit_filter": "Filter bewerken", + "content-type.change": "Inhoudstype", + "direct.group_by_conversations": "Groeperen op gesprek", "empty_column.follow_recommendations": "Het lijkt er op dat er geen aanbevelingen voor jou aangemaakt kunnen worden. Je kunt proberen te zoeken naar mensen die je wellicht kent, zoeken op hashtags, de lokale en globale tijdlijnen bekijken of de gebruikersgids doorbladeren.", + "endorsed_accounts_editor.endorsed_accounts": "Aanbevolen accounts", "follow_recommendations.done": "Klaar", "follow_recommendations.heading": "Volg mensen waarvan je graag berichten wil zien! Hier zijn enkele aanbevelingen.", "follow_recommendations.lead": "Berichten van mensen die je volgt zullen in chronologische volgorde op jouw starttijdlijn verschijnen. Wees niet bang om hierin fouten te maken, want je kunt mensen op elk moment net zo eenvoudig ontvolgen!", + "home.column_settings.advanced": "Geavanceerd", + "navigation_bar.featured_users": "Aanbevolen gebruikers", + "notification_purge.btn_all": "Alles selecteren", + "notification_purge.btn_invert": "Selectie omkeren", + "notifications.marked_clear": "Wis geselecteerde meldingen", + "notifications.marked_clear_confirmation": "Weet je zeker dat je alle geselecteerde meldingen permanent wilt wissen?", + "onboarding.next": "Volgende", + "onboarding.page_four.notifications": "Het meldingenkolom toont wanneer iemand met je omgaat.", "onboarding.page_one.federation": "{domain} is an \"instance\" of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.", "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}. Glitchsoc is fully compatible with all Mastodon apps and instances. Glitchsoc is free open-source software. You can report bugs, request features, or contribute to the code on {github}.", + "settings.auto_collapse_height": "Hoogte (in pixels) voor een toot om als lang beschouwd te worden", + "settings.auto_collapse_lengthy": "Lange toots", + "settings.auto_collapse_media": "Toots met media", + "settings.auto_collapse_notifications": "Meldingen", + "settings.auto_collapse_reblogs": "Boosts", + "settings.auto_collapse_replies": "Antwoorden", + "settings.close": "Sluiten", "settings.content_warnings": "Content warnings", + "settings.general": "Algemeen", + "settings.media": "Media", + "settings.notifications.favicon_badge": "Ongelezen meldingen badge op favicon", + "settings.notifications_opts": "Meldingsopties", + "settings.pop_in_left": "Linkerkant", + "settings.pop_in_right": "Rechterkant", "settings.preferences": "Preferences" } diff --git a/app/javascript/flavours/glitch/locales/uk.json b/app/javascript/flavours/glitch/locales/uk.json index a8f6e42e849a34..917bc2c0110d78 100644 --- a/app/javascript/flavours/glitch/locales/uk.json +++ b/app/javascript/flavours/glitch/locales/uk.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "Наведена нижче інформація може не повністю відображати профіль користувача.", "account.follows": "Підписки", "account.joined": "Приєднався {date}", + "account.mute_notifications": "Не показувати сповіщення від @{name}", "account.suspended_disclaimer_full": "Цей користувач був призупинений модератором.", + "account.unmute_notifications": "Показувати сповіщення від @{name}", "account.view_full_profile": "Переглянути повний профіль", "account_note.cancel": "Скасувати", "account_note.edit": "Змінити", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Схоже, для вас не було створено жодної пропозиції. Ви можете спробувати скористатися пошуком людей, яких ви можете знати, або переглянути популярні гештеґи.", "endorsed_accounts_editor.endorsed_accounts": "Рекомендовані облікові записи", "favourite_modal.combo": "Ви можете натиснути {combo}, щоб пропустити це наступного разу", + "firehose.column_settings.allow_local_only": "Відображати локальні повідомлення в \"Все\"", "follow_recommendations.done": "Готово", "follow_recommendations.heading": "Підпишіться на людей, чиї дописи ви хочете бачити! Ось деякі пропозиції.", "follow_recommendations.lead": "Дописи від людей, за якими ви стежите, з'являться в хронологічному порядку у вашій домашній стрічці. Не бійся помилятися, ви можете відписатися від людей так само легко в будь-який час!", diff --git a/app/javascript/flavours/glitch/locales/zh-TW.json b/app/javascript/flavours/glitch/locales/zh-TW.json index 221d8f9d68f102..3411876e3927b6 100644 --- a/app/javascript/flavours/glitch/locales/zh-TW.json +++ b/app/javascript/flavours/glitch/locales/zh-TW.json @@ -15,19 +15,19 @@ "advanced_options.icon_title": "進階選項", "advanced_options.local-only.long": "不要傳遞給其他實例", "advanced_options.local-only.short": "僅限本地", - "advanced_options.local-only.tooltip": "此嘟文僅限本地", + "advanced_options.local-only.tooltip": "此貼文僅限本地", "advanced_options.threaded_mode.long": "發佈時自動打開回覆", "advanced_options.threaded_mode.short": "討論串模式", "advanced_options.threaded_mode.tooltip": "已啟用討論串模式", - "boost_modal.missing_description": "此嘟文包含未加說明的媒體檔案", + "boost_modal.missing_description": "此貼文包含未加說明的媒體檔案", "column.favourited_by": "誰按了最愛", "column.heading": "雜項", - "column.reblogged_by": "被誰轉嘟", + "column.reblogged_by": "被誰轉貼", "column.subheading": "其他選項", "column_header.profile": "個人檔案", "column_subheading.lists": "列表", "column_subheading.navigation": "導覽", - "community.column_settings.allow_local_only": "顯示僅限本地的嘟文", + "community.column_settings.allow_local_only": "顯示僅限本地的貼文", "compose.attach": "附加...", "compose.attach.doodle": "塗鴉", "compose.attach.upload": "上傳檔案", @@ -42,7 +42,7 @@ "confirmations.deprecated_settings.message": "您正在使用的某些特定於 glitch-soc 設備的 {app_settings} 已被 Mastodon {preferences} 所取代,並將被覆蓋:", "confirmations.missing_media_description.confirm": "仍要張貼", "confirmations.missing_media_description.edit": "編輯媒體", - "confirmations.missing_media_description.message": "至少有一個媒體附件缺少說明。 在發送嘟文之前,請考慮為視障人士在所有媒體附件加上說明。", + "confirmations.missing_media_description.message": "至少有一個媒體附件缺少說明。 在發送貼文之前,請考慮為視障人士在所有媒體附件加上說明。", "confirmations.unfilter.author": "作者", "confirmations.unfilter.confirm": "顯示", "confirmations.unfilter.edit_filter": "編輯篩選器", @@ -53,16 +53,16 @@ "favourite_modal.combo": "下次您可以按 {combo} 跳過", "firehose.column_settings.allow_local_only": "在「全部」顯示僅限本地的貼文", "follow_recommendations.done": "完成", - "follow_recommendations.heading": "跟隨您想檢視其嘟文的人!這裡有一些建議。", - "follow_recommendations.lead": "來自您跟隨的人之嘟文將會按時間順序顯示在您的首頁時間軸上。不要害怕犯錯,您隨時都可以取消跟隨其他人!", + "follow_recommendations.heading": "跟隨您想檢視其貼文的人!這裡有一些建議。", + "follow_recommendations.lead": "來自您跟隨的人之貼文將會按時間順序顯示在您的首頁時間軸上。不要害怕犯錯,您隨時都可以取消跟隨其他人!", "getting_started.onboarding": "帶我四處看看", "home.column_settings.advanced": "進階設定", "home.column_settings.filter_regex": "以正規表達式進行過濾", "home.column_settings.show_direct": "顯示私人提及", "home.settings": "欄位設定", "keyboard_shortcuts.bookmark": "到書籤", - "keyboard_shortcuts.secondary_toot": "使用次要隱私設定來發布嘟文", - "keyboard_shortcuts.toggle_collapse": "去折疊/展開嘟文", + "keyboard_shortcuts.secondary_toot": "使用次要隱私設定來發布貼文", + "keyboard_shortcuts.toggle_collapse": "去折疊/展開貼文", "media_gallery.sensitive": "敏感", "moved_to_warning": "此帳戶已標記為移至 {moved_to_link},因此可能不接受新的追隨者。", "navigation_bar.app_settings": "應用程式設定", @@ -99,37 +99,37 @@ "settings.always_show_spoilers_field": "永遠啟用內容警告欄位", "settings.auto_collapse": "自動折疊", "settings.auto_collapse_all": "全部", - "settings.auto_collapse_height": "高度超過多少像素會被視為較長的嘟文", - "settings.auto_collapse_lengthy": "較長的嘟文", - "settings.auto_collapse_media": "包含媒體檔案的嘟文", + "settings.auto_collapse_height": "高度超過多少像素會被視為較長的貼文", + "settings.auto_collapse_lengthy": "較長的貼文", + "settings.auto_collapse_media": "包含媒體檔案的貼文", "settings.auto_collapse_notifications": "通知", - "settings.auto_collapse_reblogs": "轉嘟", + "settings.auto_collapse_reblogs": "轉貼", "settings.auto_collapse_replies": "回覆", "settings.close": "關閉", - "settings.collapsed_statuses": "折疊的嘟文", - "settings.compose_box_opts": "嘟文撰寫框", - "settings.confirm_before_clearing_draft": "在覆蓋編輯中的嘟文前顯示確認對話框", - "settings.confirm_boost_missing_media_description": "在轉嘟包含缺少說明的媒體檔案的嘟文前顯示確認對話框", - "settings.confirm_missing_media_description": "在發出包含缺少說明的媒體檔案的嘟文前顯示確認對話框", + "settings.collapsed_statuses": "折疊的貼文", + "settings.compose_box_opts": "貼文撰寫框", + "settings.confirm_before_clearing_draft": "在覆蓋編輯中的貼文前顯示確認對話框", + "settings.confirm_boost_missing_media_description": "在轉貼包含缺少說明的媒體檔案的貼文前顯示確認對話框", + "settings.confirm_missing_media_description": "在發出包含缺少說明的媒體檔案的貼文前顯示確認對話框", "settings.content_warnings": "內容警告", "settings.content_warnings.regexp": "正規表達式", "settings.content_warnings_filter": "不要自動展開內容警告:", "settings.content_warnings_media_outside": "在內容警告外顯示媒體檔案", "settings.content_warnings_media_outside_hint": "透過內容警告切換不影響媒體檔案來重現上游 Mastodon 行為", "settings.content_warnings_shared_state": "一次顯示/隱藏所有副本的內容", - "settings.content_warnings_shared_state_hint": "透過內容警告按鈕同時影響嘟文的所有副本來重現上游 Mastodon 行為。 這將防止任何帶有展開的內容警告的嘟文副本自動折疊", + "settings.content_warnings_shared_state_hint": "透過內容警告按鈕同時影響貼文的所有副本來重現上游 Mastodon 行為。 這將防止任何帶有展開的內容警告的貼文副本自動折疊", "settings.content_warnings_unfold_opts": "自動展開選項", "settings.deprecated_setting": "此設定現在已由 Mastodon 的 {settings_page_link} 控制。", - "settings.enable_collapsed": "啟用折疊的嘟文", - "settings.enable_collapsed_hint": "折疊的嘟文隱藏了部分內容,以佔用更少的屏幕空間。這與內容警告功能不同", + "settings.enable_collapsed": "啟用折疊的貼文", + "settings.enable_collapsed_hint": "折疊的貼文隱藏了部分內容,以佔用更少的螢幕空間。這與內容警告功能不同", "settings.enable_content_warnings_auto_unfold": "自動展開內容警告", "settings.general": "一般設定", "settings.hicolor_privacy_icons": "隱私圖示使用對比色", "settings.hicolor_privacy_icons.hint": "用明亮且易於區分的顏色顯示隱私圖示", "settings.image_backgrounds": "圖片背景", - "settings.image_backgrounds_media": "預覽折疊嘟文的媒體檔案", - "settings.image_backgrounds_media_hint": "如果嘟文包含媒體檔案,使用第一個作為圖片背景", - "settings.image_backgrounds_users": "為折疊的嘟文加上圖片背景", + "settings.image_backgrounds_media": "預覽折疊貼文的媒體檔案", + "settings.image_backgrounds_media_hint": "如果貼文包含媒體檔案,使用第一個作為圖片背景", + "settings.image_backgrounds_users": "為折疊的貼文加上圖片背景", "settings.inline_preview_cards": "針對外部連接顯示內嵌的預覽卡", "settings.layout_opts": "版面選項", "settings.media": "媒體", @@ -150,26 +150,26 @@ "settings.prepend_cw_re": "回覆時在內容警告前添加 \"re:\"", "settings.preselect_on_reply": "回覆時預先選擇用戶名稱", "settings.preselect_on_reply_hint": "回覆與多個參與者的對話時,預先選擇第一個參與者之後的用戶名稱", - "settings.rewrite_mentions": "改寫已顯示嘟文中的提及", + "settings.rewrite_mentions": "改寫已顯示貼文中的提及", "settings.rewrite_mentions_acct": "改寫為使用者名稱與網域(當使用者來自外部)", "settings.rewrite_mentions_no": "不要改寫提及", "settings.rewrite_mentions_username": "改寫為使用者名稱", "settings.shared_settings_link": "使用者偏好設定", - "settings.show_action_bar": "在折疊的嘟文顯示操作按鈕", - "settings.show_content_type_choice": "在編寫嘟文時顯示內容類型選擇", + "settings.show_action_bar": "在折疊的貼文顯示操作按鈕", + "settings.show_content_type_choice": "在編寫貼文時顯示內容類型選擇", "settings.show_reply_counter": "顯示回覆數量的估計值", - "settings.side_arm": "次要發出嘟文按鈕", + "settings.side_arm": "次要發出貼文按鈕", "settings.side_arm.none": "無", - "settings.side_arm_reply_mode": "當回覆一篇嘟文時,次要發出嘟文按鈕應該設為:", - "settings.side_arm_reply_mode.copy": "複製回覆嘟文的隱私設置", + "settings.side_arm_reply_mode": "當回覆一篇貼文時,次要發出嘟文按鈕應該設為:", + "settings.side_arm_reply_mode.copy": "複製回覆貼文的隱私設置", "settings.side_arm_reply_mode.keep": "保持原本的隱私設定", - "settings.side_arm_reply_mode.restrict": "限制只能使用與回覆嘟文相同的隱私設置", - "settings.status_icons": "嘟文圖示", + "settings.side_arm_reply_mode.restrict": "限制只能使用與回覆貼文相同的隱私設置", + "settings.status_icons": "貼文圖示", "settings.status_icons_language": "語言指示器", "settings.status_icons_local_only": "僅限本地指示器", "settings.status_icons_media": "媒體與投票指示器", "settings.status_icons_reply": "回覆指示器", - "settings.status_icons_visibility": "嘟文隱私指示器", + "settings.status_icons_visibility": "貼文隱私指示器", "settings.swipe_to_change_columns": "允許使用滑動手勢更改顯示欄位(僅限移動裝置)", "settings.tag_misleading_links": "標記誤導性的連結", "settings.tag_misleading_links.hint": "在每個未明確提及的連結添加帶有連結目標主機的視覺指示", @@ -180,8 +180,8 @@ "status.has_pictures": "包含圖片", "status.has_preview_card": "包含預覽卡", "status.has_video": "包含視訊檔案", - "status.in_reply_to": "嘟文有回覆", - "status.is_poll": "嘟文有投票", + "status.in_reply_to": "貼文有回覆", + "status.is_poll": "貼文有投票", "status.local_only": "只在此實例可見", "status.sensitive_toggle": "點擊查看", "status.uncollapse": "展開", diff --git a/app/javascript/flavours/glitch/reducers/alerts.js b/app/javascript/flavours/glitch/reducers/alerts.js index 4e237d419d2aba..bd49d748f97d7a 100644 --- a/app/javascript/flavours/glitch/reducers/alerts.js +++ b/app/javascript/flavours/glitch/reducers/alerts.js @@ -4,7 +4,7 @@ import { ALERT_SHOW, ALERT_DISMISS, ALERT_CLEAR, -} from 'flavours/glitch/actions/alerts'; +} from '../actions/alerts'; const initialState = ImmutableList([]); diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 0915ecba0f21bb..d71148be2838cf 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -51,16 +51,15 @@ import { COMPOSE_CHANGE_MEDIA_DESCRIPTION, COMPOSE_CHANGE_MEDIA_FOCUS, COMPOSE_SET_STATUS, -} from 'flavours/glitch/actions/compose'; -import { REDRAFT } from 'flavours/glitch/actions/statuses'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; -import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines'; -import { me, defaultContentType } from 'flavours/glitch/initial_state'; -import { recoverHashtags } from 'flavours/glitch/utils/hashtag'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; -import { overwrite } from 'flavours/glitch/utils/js_helpers'; -import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; - +} from '../actions/compose'; +import { REDRAFT } from '../actions/statuses'; +import { STORE_HYDRATE } from '../actions/store'; +import { TIMELINE_DELETE } from '../actions/timelines'; +import { me, defaultContentType } from '../initial_state'; +import { recoverHashtags } from '../utils/hashtag'; +import { unescapeHTML } from '../utils/html'; +import { overwrite } from '../utils/js_helpers'; +import { privacyPreference } from '../utils/privacy_preference'; import { uuid } from '../uuid'; const totalElefriends = 3; diff --git a/app/javascript/flavours/glitch/reducers/contexts.js b/app/javascript/flavours/glitch/reducers/contexts.js index 552709383e0111..32e194dd42568c 100644 --- a/app/javascript/flavours/glitch/reducers/contexts.js +++ b/app/javascript/flavours/glitch/reducers/contexts.js @@ -3,10 +3,9 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable'; import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, -} from 'flavours/glitch/actions/accounts'; -import { CONTEXT_FETCH_SUCCESS } from 'flavours/glitch/actions/statuses'; -import { TIMELINE_DELETE, TIMELINE_UPDATE } from 'flavours/glitch/actions/timelines'; - +} from '../actions/accounts'; +import { CONTEXT_FETCH_SUCCESS } from '../actions/statuses'; +import { TIMELINE_DELETE, TIMELINE_UPDATE } from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap({ @@ -68,7 +67,8 @@ const deleteFromContexts = (immutableState, ids) => immutableState.withMutations }); const filterContexts = (state, relationship, statuses) => { - const ownedStatusIds = statuses.filter(status => status.get('account') === relationship.id) + const ownedStatusIds = statuses + .filter(status => status.get('account') === relationship.id) .map(status => status.get('id')); return deleteFromContexts(state, ownedStatusIds); diff --git a/app/javascript/flavours/glitch/reducers/custom_emojis.js b/app/javascript/flavours/glitch/reducers/custom_emojis.js index 13396db7e77ee6..56ec80f2ffce22 100644 --- a/app/javascript/flavours/glitch/reducers/custom_emojis.js +++ b/app/javascript/flavours/glitch/reducers/custom_emojis.js @@ -1,8 +1,8 @@ import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable'; -import { CUSTOM_EMOJIS_FETCH_SUCCESS } from 'flavours/glitch/actions/custom_emojis'; -import { buildCustomEmojis } from 'flavours/glitch/features/emoji/emoji'; -import { search as emojiSearch } from 'flavours/glitch/features/emoji/emoji_mart_search_light'; +import { CUSTOM_EMOJIS_FETCH_SUCCESS } from '../actions/custom_emojis'; +import { buildCustomEmojis } from '../features/emoji/emoji'; +import { search as emojiSearch } from '../features/emoji/emoji_mart_search_light'; const initialState = ImmutableList([]); diff --git a/app/javascript/flavours/glitch/reducers/height_cache.js b/app/javascript/flavours/glitch/reducers/height_cache.js index 89282994e3bb54..2664d4f82463f7 100644 --- a/app/javascript/flavours/glitch/reducers/height_cache.js +++ b/app/javascript/flavours/glitch/reducers/height_cache.js @@ -1,6 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; -import { HEIGHT_CACHE_SET, HEIGHT_CACHE_CLEAR } from 'flavours/glitch/actions/height_cache'; +import { HEIGHT_CACHE_SET, HEIGHT_CACHE_CLEAR } from '../actions/height_cache'; const initialState = ImmutableMap(); diff --git a/app/javascript/flavours/glitch/reducers/index.ts b/app/javascript/flavours/glitch/reducers/index.ts index a87e75fcad3640..79febbce3d01cd 100644 --- a/app/javascript/flavours/glitch/reducers/index.ts +++ b/app/javascript/flavours/glitch/reducers/index.ts @@ -68,8 +68,8 @@ const reducers = { push_notifications, mutes, blocks, - server, boosts, + server, contexts, compose, search, diff --git a/app/javascript/flavours/glitch/reducers/media_attachments.js b/app/javascript/flavours/glitch/reducers/media_attachments.js index 5086126ab7feeb..cbb4933bc7efa8 100644 --- a/app/javascript/flavours/glitch/reducers/media_attachments.js +++ b/app/javascript/flavours/glitch/reducers/media_attachments.js @@ -1,6 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; +import { STORE_HYDRATE } from '../actions/store'; const initialState = ImmutableMap({ accept_content_types: [], diff --git a/app/javascript/flavours/glitch/reducers/mutes.js b/app/javascript/flavours/glitch/reducers/mutes.js index d346d9a78a347e..a9eb61ff834cbc 100644 --- a/app/javascript/flavours/glitch/reducers/mutes.js +++ b/app/javascript/flavours/glitch/reducers/mutes.js @@ -4,7 +4,7 @@ import { MUTES_INIT_MODAL, MUTES_TOGGLE_HIDE_NOTIFICATIONS, MUTES_CHANGE_DURATION, -} from 'flavours/glitch/actions/mutes'; +} from '../actions/mutes'; const initialState = Immutable.Map({ new: Immutable.Map({ diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js index 9a4b75dce1aacd..7bb11459ca35a9 100644 --- a/app/javascript/flavours/glitch/reducers/notifications.js +++ b/app/javascript/flavours/glitch/reducers/notifications.js @@ -1,15 +1,16 @@ import { fromJS, Map as ImmutableMap, List as ImmutableList } from 'immutable'; +import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks'; + import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; -import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks'; +} from '../actions/accounts'; import { MARKERS_FETCH_SUCCESS, -} from 'flavours/glitch/actions/markers'; +} from '../actions/markers'; import { NOTIFICATIONS_MOUNT, NOTIFICATIONS_UNMOUNT, @@ -31,9 +32,8 @@ import { NOTIFICATIONS_MARK_AS_READ, NOTIFICATIONS_SET_BROWSER_SUPPORT, NOTIFICATIONS_SET_BROWSER_PERMISSION, -} from 'flavours/glitch/actions/notifications'; -import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from 'flavours/glitch/actions/timelines'; - +} from '../actions/notifications'; +import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap({ diff --git a/app/javascript/flavours/glitch/reducers/picture_in_picture.js b/app/javascript/flavours/glitch/reducers/picture_in_picture.js index 395c21245f49fa..961fc5699c1b3b 100644 --- a/app/javascript/flavours/glitch/reducers/picture_in_picture.js +++ b/app/javascript/flavours/glitch/reducers/picture_in_picture.js @@ -1,5 +1,6 @@ import { PICTURE_IN_PICTURE_DEPLOY, PICTURE_IN_PICTURE_REMOVE } from 'flavours/glitch/actions/picture_in_picture'; -import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines'; + +import { TIMELINE_DELETE } from '../actions/timelines'; const initialState = { statusId: null, diff --git a/app/javascript/flavours/glitch/reducers/push_notifications.js b/app/javascript/flavours/glitch/reducers/push_notifications.js index 23aa9bd03354c3..fa8af0e8ccbdaf 100644 --- a/app/javascript/flavours/glitch/reducers/push_notifications.js +++ b/app/javascript/flavours/glitch/reducers/push_notifications.js @@ -1,7 +1,7 @@ import Immutable from 'immutable'; -import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from 'flavours/glitch/actions/push_notifications'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; +import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from '../actions/push_notifications'; +import { STORE_HYDRATE } from '../actions/store'; const initialState = Immutable.Map({ subscription: null, diff --git a/app/javascript/flavours/glitch/reducers/relationships.js b/app/javascript/flavours/glitch/reducers/relationships.js index 38fd0caa490b92..d1ccf9ac953049 100644 --- a/app/javascript/flavours/glitch/reducers/relationships.js +++ b/app/javascript/flavours/glitch/reducers/relationships.js @@ -2,7 +2,7 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; import { ACCOUNT_NOTE_SUBMIT_SUCCESS, -} from 'flavours/glitch/actions/account_notes'; +} from '../actions/account_notes'; import { ACCOUNT_FOLLOW_SUCCESS, ACCOUNT_FOLLOW_REQUEST, @@ -19,12 +19,11 @@ import { RELATIONSHIPS_FETCH_SUCCESS, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { DOMAIN_BLOCK_SUCCESS, DOMAIN_UNBLOCK_SUCCESS, -} from 'flavours/glitch/actions/domain_blocks'; - +} from '../actions/domain_blocks'; import { NOTIFICATIONS_UPDATE, } from '../actions/notifications'; diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index e4144db62e0d52..72835eb91745f3 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -4,7 +4,7 @@ import { COMPOSE_MENTION, COMPOSE_REPLY, COMPOSE_DIRECT, -} from 'flavours/glitch/actions/compose'; +} from '../actions/compose'; import { SEARCH_CHANGE, SEARCH_CLEAR, @@ -16,7 +16,7 @@ import { SEARCH_EXPAND_SUCCESS, SEARCH_EXPAND_FAIL, SEARCH_HISTORY_UPDATE, -} from 'flavours/glitch/actions/search'; +} from '../actions/search'; const initialState = ImmutableMap({ value: '', diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 748523176b7314..736fbf7523758e 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -1,13 +1,12 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; -import { COLUMN_ADD, COLUMN_REMOVE, COLUMN_MOVE, COLUMN_PARAMS_CHANGE } from 'flavours/glitch/actions/columns'; -import { EMOJI_USE } from 'flavours/glitch/actions/emojis'; -import { LANGUAGE_USE } from 'flavours/glitch/actions/languages'; -import { NOTIFICATIONS_FILTER_SET } from 'flavours/glitch/actions/notifications'; -import { SETTING_CHANGE, SETTING_SAVE } from 'flavours/glitch/actions/settings'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; - +import { COLUMN_ADD, COLUMN_REMOVE, COLUMN_MOVE, COLUMN_PARAMS_CHANGE } from '../actions/columns'; +import { EMOJI_USE } from '../actions/emojis'; +import { LANGUAGE_USE } from '../actions/languages'; import { LIST_DELETE_SUCCESS, LIST_FETCH_FAIL } from '../actions/lists'; +import { NOTIFICATIONS_FILTER_SET } from '../actions/notifications'; +import { SETTING_CHANGE, SETTING_SAVE } from '../actions/settings'; +import { STORE_HYDRATE } from '../actions/store'; import { uuid } from '../uuid'; const initialState = ImmutableMap({ diff --git a/app/javascript/flavours/glitch/reducers/status_lists.js b/app/javascript/flavours/glitch/reducers/status_lists.js index c4780a661f2d8a..41cc07341c4969 100644 --- a/app/javascript/flavours/glitch/reducers/status_lists.js +++ b/app/javascript/flavours/glitch/reducers/status_lists.js @@ -3,7 +3,7 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutabl import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { BOOKMARKED_STATUSES_FETCH_REQUEST, BOOKMARKED_STATUSES_FETCH_SUCCESS, @@ -11,7 +11,7 @@ import { BOOKMARKED_STATUSES_EXPAND_REQUEST, BOOKMARKED_STATUSES_EXPAND_SUCCESS, BOOKMARKED_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/bookmarks'; +} from '../actions/bookmarks'; import { FAVOURITED_STATUSES_FETCH_REQUEST, FAVOURITED_STATUSES_FETCH_SUCCESS, @@ -19,7 +19,7 @@ import { FAVOURITED_STATUSES_EXPAND_REQUEST, FAVOURITED_STATUSES_EXPAND_SUCCESS, FAVOURITED_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/favourites'; +} from '../actions/favourites'; import { FAVOURITE_SUCCESS, UNFAVOURITE_SUCCESS, @@ -27,10 +27,10 @@ import { UNBOOKMARK_SUCCESS, PIN_SUCCESS, UNPIN_SUCCESS, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { PINNED_STATUSES_FETCH_SUCCESS, -} from 'flavours/glitch/actions/pin_statuses'; +} from '../actions/pin_statuses'; import { TRENDS_STATUSES_FETCH_REQUEST, TRENDS_STATUSES_FETCH_SUCCESS, @@ -38,7 +38,7 @@ import { TRENDS_STATUSES_EXPAND_REQUEST, TRENDS_STATUSES_EXPAND_SUCCESS, TRENDS_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/trends'; +} from '../actions/trends'; diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index 5f8d9c59a0f45d..a43b220199832e 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -1,5 +1,7 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; +import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; +import { normalizeStatusTranslation } from '../actions/importer/normalizer'; import { REBLOG_REQUEST, REBLOG_FAIL, @@ -18,7 +20,7 @@ import { REACTION_REMOVE_FAIL, REACTION_ADD_REQUEST, REACTION_REMOVE_REQUEST, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { STATUS_MUTE_SUCCESS, STATUS_UNMUTE_SUCCESS, @@ -29,13 +31,8 @@ import { STATUS_TRANSLATE_UNDO, STATUS_FETCH_REQUEST, STATUS_FETCH_FAIL, -} from 'flavours/glitch/actions/statuses'; -import { - TIMELINE_DELETE, -} from 'flavours/glitch/actions/timelines'; - -import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; -import { normalizeStatusTranslation } from '../actions/importer/normalizer'; +} from '../actions/statuses'; +import { TIMELINE_DELETE } from '../actions/timelines'; const importStatus = (state, status) => state.set(status.id, fromJS(status)); diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index 76bc6c81746deb..69f28d6849a3d8 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -4,7 +4,7 @@ import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, ACCOUNT_UNFOLLOW_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { TIMELINE_UPDATE, TIMELINE_DELETE, @@ -17,8 +17,7 @@ import { TIMELINE_DISCONNECT, TIMELINE_LOAD_PENDING, TIMELINE_MARK_AS_PARTIAL, -} from 'flavours/glitch/actions/timelines'; - +} from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap(); diff --git a/app/javascript/flavours/glitch/reducers/user_lists.js b/app/javascript/flavours/glitch/reducers/user_lists.js index d37451d0050034..76786b42201802 100644 --- a/app/javascript/flavours/glitch/reducers/user_lists.js +++ b/app/javascript/flavours/glitch/reducers/user_lists.js @@ -1,5 +1,19 @@ import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable'; +import { + DIRECTORY_FETCH_REQUEST, + DIRECTORY_FETCH_SUCCESS, + DIRECTORY_FETCH_FAIL, + DIRECTORY_EXPAND_REQUEST, + DIRECTORY_EXPAND_SUCCESS, + DIRECTORY_EXPAND_FAIL, +} from 'flavours/glitch/actions/directory'; +import { + FEATURED_TAGS_FETCH_REQUEST, + FEATURED_TAGS_FETCH_SUCCESS, + FEATURED_TAGS_FETCH_FAIL, +} from 'flavours/glitch/actions/featured_tags'; + import { FOLLOWERS_FETCH_REQUEST, FOLLOWERS_FETCH_SUCCESS, @@ -21,7 +35,7 @@ import { FOLLOW_REQUESTS_EXPAND_FAIL, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { BLOCKS_FETCH_REQUEST, BLOCKS_FETCH_SUCCESS, @@ -29,20 +43,7 @@ import { BLOCKS_EXPAND_REQUEST, BLOCKS_EXPAND_SUCCESS, BLOCKS_EXPAND_FAIL, -} from 'flavours/glitch/actions/blocks'; -import { - DIRECTORY_FETCH_REQUEST, - DIRECTORY_FETCH_SUCCESS, - DIRECTORY_FETCH_FAIL, - DIRECTORY_EXPAND_REQUEST, - DIRECTORY_EXPAND_SUCCESS, - DIRECTORY_EXPAND_FAIL, -} from 'flavours/glitch/actions/directory'; -import { - FEATURED_TAGS_FETCH_REQUEST, - FEATURED_TAGS_FETCH_SUCCESS, - FEATURED_TAGS_FETCH_FAIL, -} from 'flavours/glitch/actions/featured_tags'; +} from '../actions/blocks'; import { REBLOGS_FETCH_REQUEST, REBLOGS_FETCH_SUCCESS, @@ -56,7 +57,7 @@ import { FAVOURITES_EXPAND_REQUEST, FAVOURITES_EXPAND_SUCCESS, FAVOURITES_EXPAND_FAIL, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { MUTES_FETCH_REQUEST, MUTES_FETCH_SUCCESS, @@ -64,13 +65,13 @@ import { MUTES_EXPAND_REQUEST, MUTES_EXPAND_SUCCESS, MUTES_EXPAND_FAIL, -} from 'flavours/glitch/actions/mutes'; - +} from '../actions/mutes'; import { NOTIFICATIONS_UPDATE, } from '../actions/notifications'; + const initialListState = ImmutableMap({ next: null, isLoading: false, diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js index a296ef8ede2dc0..74188aff6d419a 100644 --- a/app/javascript/flavours/glitch/selectors/index.js +++ b/app/javascript/flavours/glitch/selectors/index.js @@ -1,9 +1,10 @@ import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; import { createSelector } from 'reselect'; -import { me } from 'flavours/glitch/initial_state'; import { toServerSideType } from 'flavours/glitch/utils/filters'; +import { me } from '../initial_state'; + const getAccountBase = (state, id) => state.getIn(['accounts', id], null); const getAccountCounters = (state, id) => state.getIn(['accounts_counters', id], null); const getAccountRelationship = (state, id) => state.getIn(['relationships', id], null); diff --git a/app/javascript/flavours/glitch/store/middlewares/errors.ts b/app/javascript/flavours/glitch/store/middlewares/errors.ts index 2697f80f189113..4e720bfed4e940 100644 --- a/app/javascript/flavours/glitch/store/middlewares/errors.ts +++ b/app/javascript/flavours/glitch/store/middlewares/errors.ts @@ -1,8 +1,7 @@ import type { AnyAction, Middleware } from 'redux'; -import { showAlertForError } from 'flavours/glitch/actions/alerts'; - import type { RootState } from '..'; +import { showAlertForError } from '../../actions/alerts'; const defaultFailSuffix = 'FAIL'; diff --git a/app/javascript/flavours/glitch/stream.js b/app/javascript/flavours/glitch/stream.js index 55f009e130307f..ff3af5fd885c96 100644 --- a/app/javascript/flavours/glitch/stream.js +++ b/app/javascript/flavours/glitch/stream.js @@ -1,6 +1,7 @@ // @ts-check import WebSocketClient from '@gamestdio/websocket'; + /** * @type {WebSocketClient | undefined} */ @@ -85,12 +86,12 @@ const unsubscribe = ({ channelName, params, onDisconnect }) => { }; const sharedCallbacks = { - connected () { + connected() { subscriptions.forEach(subscription => subscribe(subscription)); }, // @ts-expect-error - received (data) { + received(data) { const { stream } = data; subscriptions.filter(({ channelName, params }) => { @@ -114,11 +115,11 @@ const sharedCallbacks = { }); }, - disconnected () { + disconnected() { subscriptions.forEach(subscription => unsubscribe(subscription)); }, - reconnected () { + reconnected() { }, }; @@ -151,19 +152,19 @@ export const connectStream = (channelName, params, callbacks) => (dispatch, getS // to using individual connections for each channel if (!streamingAPIBaseURL.startsWith('ws')) { const connection = createConnection(streamingAPIBaseURL, accessToken, channelNameWithInlineParams(channelName, params), { - connected () { + connected() { onConnect(); }, - received (data) { + received(data) { onReceive(data); }, - disconnected () { + disconnected() { onDisconnect(); }, - reconnected () { + reconnected() { onConnect(); }, }); @@ -239,10 +240,10 @@ const createConnection = (streamingAPIBaseURL, accessToken, channelName, { conne const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken); // @ts-expect-error - ws.onopen = connected; - ws.onmessage = e => received(JSON.parse(e.data)); + ws.onopen = connected; + ws.onmessage = e => received(JSON.parse(e.data)); // @ts-expect-error - ws.onclose = disconnected; + ws.onclose = disconnected; // @ts-expect-error ws.onreconnect = reconnected; @@ -265,7 +266,7 @@ const createConnection = (streamingAPIBaseURL, accessToken, channelName, { conne }; KNOWN_EVENT_TYPES.forEach(type => { - es.addEventListener(type, e => handleEventSourceMessage(/** @type {MessageEvent} */ (e), received)); + es.addEventListener(type, e => handleEventSourceMessage(/** @type {MessageEvent} */(e), received)); }); es.onerror = /** @type {function(): void} */ (disconnected); diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index 3b85dfbf15e302..0f64c0dcc10f5a 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -104,10 +104,7 @@ } input[type='checkbox'] { - display: none; - } - - .checkbox { + appearance: none; display: inline-block; position: relative; border: 1px solid $ui-primary-color; @@ -120,8 +117,9 @@ top: -1px; border-radius: 4px; vertical-align: middle; + cursor: inherit; - &.active { + &:checked { border-color: $highlight-text-color; background: $highlight-text-color url("data:image/svg+xml;utf8,") @@ -310,9 +308,9 @@ background: darken($ui-secondary-color, 10%); } - > .account, - > .emoji, - > .autosuggest-hashtag { + .autosuggest-account, + .autosuggest-emoji, + .autosuggest-hashtag { display: flex; flex-direction: row; align-items: center; @@ -344,12 +342,13 @@ } } - & > .account.small { - .display-name { - & > span { - color: $lighter-text-color; - } - } + .autosuggest-account-icon, + .autosuggest-emoji img { + margin-inline-end: 8px; + } + + .autosuggest-account .display-name > span { + color: $lighter-text-color; } } diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index 8a40a89446cc9d..fe47f4616bacc9 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -1185,3 +1185,30 @@ a.status-card.compact:hover { border-color: lighten($ui-base-color, 12%); } } + +.hashtag-bar { + margin-top: 16px; + display: flex; + flex-wrap: wrap; + font-size: 14px; + line-height: 18px; + gap: 4px; + color: $darker-text-color; + + a { + display: inline-flex; + color: inherit; + text-decoration: none; + + &:hover span { + text-decoration: underline; + } + } + + .link-button { + color: inherit; + font-size: inherit; + line-height: inherit; + padding: 0; + } +} diff --git a/app/javascript/flavours/glitch/utils/html.js b/app/javascript/flavours/glitch/utils/html.js index 5159df9db75beb..247e98c88a7f31 100644 --- a/app/javascript/flavours/glitch/utils/html.js +++ b/app/javascript/flavours/glitch/utils/html.js @@ -1,3 +1,4 @@ +// NB: This function can still return unsafe HTML export const unescapeHTML = (html) => { const wrapper = document.createElement('div'); wrapper.innerHTML = html.replace(//g, '\n').replace(/<\/p>

/g, '\n\n').replace(/<[^>]*>/g, ''); diff --git a/app/javascript/flavours/glitch/utils/icons.jsx b/app/javascript/flavours/glitch/utils/icons.jsx index 225345af6875e3..be566032e06445 100644 --- a/app/javascript/flavours/glitch/utils/icons.jsx +++ b/app/javascript/flavours/glitch/utils/icons.jsx @@ -1,3 +1,5 @@ +// Copied from emoji-mart for consistency with emoji picker and since +// they don't export the icons in the package export const loupeIcon = ( diff --git a/app/javascript/flavours/glitch/utils/notifications.js b/app/javascript/flavours/glitch/utils/notifications.js index 3cdf7caea0cbbd..42623ac7c6898c 100644 --- a/app/javascript/flavours/glitch/utils/notifications.js +++ b/app/javascript/flavours/glitch/utils/notifications.js @@ -3,7 +3,7 @@ const checkNotificationPromise = () => { try { - // eslint-disable-next-line promise/catch-or-return, promise/valid-params + // eslint-disable-next-line promise/valid-params, promise/catch-or-return Notification.requestPermission().then(); } catch(e) { return false; diff --git a/app/javascript/flavours/glitch/utils/numbers.ts b/app/javascript/flavours/glitch/utils/numbers.ts index 7139bf8039e615..35bcde83e2491a 100644 --- a/app/javascript/flavours/glitch/utils/numbers.ts +++ b/app/javascript/flavours/glitch/utils/numbers.ts @@ -1,4 +1,4 @@ -import type { ValueOf } from 'flavours/glitch/types/util'; +import type { ValueOf } from '../types/util'; export const DECIMAL_UNITS = Object.freeze({ ONE: 1, diff --git a/config/locales-glitch/de.yml b/config/locales-glitch/de.yml index 233bf91b38a93f..34d49f168207f2 100644 --- a/config/locales-glitch/de.yml +++ b/config/locales-glitch/de.yml @@ -6,7 +6,7 @@ de: batch_error: 'Ein Fehler ist aufgetreten: %{message}' settings: captcha_enabled: - desc_html: Dies beruht auf externen Skripts von hCaptcha, was Sicherheits- und Datenschutz-Bedenken auslösen kann. Zusätzlich kann das den Registrierungsprozess für manche (besonders behinderte) Leute signifikant weniger zugänglich machen. Aus diesen Gründen, bitte ziehe alternative Maßnahmen, wie Zulassungs- oder Einladungs-basierte Registrierung, in Erwägung.
Nutzer, die durch eine Einladung mit eingeschränkter Verwendungsanzahl eingeladen wurden, werden kein CAPTCHA lösen müssen + desc_html: Dies beruht auf externen Skripts von hCaptcha, was Sicherheits- und Datenschutz-Bedenken auslösen kann. Zusätzlich kann das den Registrierungsprozess für manche (besonders behinderte) Leute signifikant weniger zugänglich machen. Ziehe aus diesen Gründen bittte alternative Maßnahmen, wie Zulassungs- oder Einladungs-basierte Registrierung, in Erwägung. title: Neue Nutzer sollen ein CAPTCHA lösen müssen, um ihr Konto zu bestätigen flavour_and_skin: title: Variante und Skin diff --git a/config/locales-glitch/es.yml b/config/locales-glitch/es.yml index 4e054b056c512a..7ed39e97f02ba5 100644 --- a/config/locales-glitch/es.yml +++ b/config/locales-glitch/es.yml @@ -2,20 +2,20 @@ es: admin: custom_emojis: - batch_copy_error: Se produjo un error cuando se copian algunos emojis seleccionados %{message} - batch_error: Ocurrió un error %{message} + batch_copy_error: 'Se produjo un error al copiar algunos de los emoticonos: %{message}' + batch_error: 'Se ha producido un error: %{message}' settings: captcha_enabled: desc_html: Esto depende de scripts externos de hCaptcha, que pueden ser una preocupación de seguridad y privacidad. Además, esto puede hacer el proceso de registro significativamente menos accesible para algunas personas (especialmente minusválidos). Por estas razones, por favor considera medidas alternativas como el registro basado en la aprobación o la invitación.
Los usuarios que han sido invitados a través de una invitación de uso limitado no necesitarán resolver un CAPTCHA - title: Pedir a los usuarios nuevos resolver un CAPTCHA para confirmar su cuenta + title: Requerir que nuevas cuentas resuelvan un CAPTCHA como confirmación flavour_and_skin: - title: Sabor y apariencia + title: Diseño y apariencia hide_followers_count: - desc_html: No mostrar el conteo de seguidores en los perfiles de usuario - title: Ocultar conteo de seguidorxs + desc_html: No mostrar el número de personas que siguen a una cuenta en su perfil + title: Ocultar estadísticas de seguimiento other: preamble: Varias configuraciones de glitch-soc que no encajan en otras categorías. - title: Otro + title: Otras outgoing_spoilers: desc_html: Cuando los toots federen, agrega esta etiqueta de contenido a los toots que no tengan. Es útil si tu servidor se especializa en contenido que otros servidores desearían tener con una advertencia de contenido. Los medios también se marcarán como sensibles. title: Advertencia de contenido para publicaciones salientes @@ -26,7 +26,7 @@ es: desc_html: Además de auto-respuestas públicas (hilos), mostrar respuestas públicas en las líneas de tiempo local y pública. title: Mostrar respuestas en líneas de tiempo públicas trending_status_cw: - desc_html: Cuando las publicaciones en tendencia están habilitadas, permitir que la que contienen Advertencias de Contenido sean elegibles. Los cambios en esta configuración no son retroactivos. + desc_html: Al habilitar las publicaciones en tendencia, permitir que mensajes con Advertencias de Contenido sean elegibles. Los cambios en esta configuración no son retroactivos. title: Permitir que publicaciones con advertencias de contenido sean tendencia appearance: localization: @@ -34,9 +34,9 @@ es: glitch_guide_link_text: Igual para glitch-soc! auth: captcha_confirmation: - hint_html: ¡Solo un paso más! Para confirmar tu cuenta, este servidor requiere que resuelvas un CAPTCHA. Puedes contactar
con el administrador del servidor si tienes preguntas o necesitas ayuda para confirmar tu cuenta. - title: Verificación de usuario + hint_html: ¡Solo un paso más! Para confirmar tu cuenta, este servidor requiere que resuelvas un CAPTCHA. Puedes contactar con la administración del servidor si tienes preguntas o necesitas asistencia con la confirmación. + title: Verificación de cuenta generic: use_this: Usar settings: - flavours: Ediciones + flavours: Diseño diff --git a/config/locales-glitch/simple_form.de.yml b/config/locales-glitch/simple_form.de.yml index ff4566b852a8de..7ee62597dfb011 100644 --- a/config/locales-glitch/simple_form.de.yml +++ b/config/locales-glitch/simple_form.de.yml @@ -8,6 +8,7 @@ de: setting_default_content_type_markdown: Beim Schreiben von Toots annehmen, dass sie in Markdown für Rich-Text-Formatierung geschrieben sind, sofern nicht anders angegeben setting_default_content_type_plain: Beim Schreiben von Toots annehmen, dass sie in Klartext ohne spezielle Formatierung geschrieben sind, sofern nicht anders angegeben (standardmäßiges Mastodon-Verhalten) setting_default_language: Die Sprache deiner Toots kann automatisch erkannt werden, aber sie ist nicht immer korrekt + setting_show_followers_count: Zeige die Anzahl deiner Follower auf deinem Profil an. Wenn du sie verbirgst, wird sie auch dir verborgen, und manche Anwendungen zeigen eine negative Follower-Anzahl an. setting_skin: Verändert die ausgewählte Mastodon-Variante labels: defaults: @@ -16,6 +17,7 @@ de: setting_default_content_type_markdown: Markdown setting_default_content_type_plain: Unformatierter Text setting_favourite_modal: Bestätigungsdialog vor dem Favorisieren anzeigen (gilt nur für Glitch-Variante) + setting_show_followers_count: Zeige deine Follower-Anzahl setting_skin: Skin setting_system_emoji_font: Systemschriftart für Emojis verwenden (nur für Glitch-Variante) notification_emails: diff --git a/config/locales-glitch/simple_form.es-MX.yml b/config/locales-glitch/simple_form.es-MX.yml index 39a88a31130a1e..a21f6b058f471d 100644 --- a/config/locales-glitch/simple_form.es-MX.yml +++ b/config/locales-glitch/simple_form.es-MX.yml @@ -8,6 +8,7 @@ es-MX: setting_default_content_type_markdown: Al escribir toots, asume que estás usando Markdown para dar formato de texto enriquecido, a menos que se especifique lo contrario setting_default_content_type_plain: Al escribir toots, asume que estás usando texto sin formato, a menos que se especifique lo contrario (predeterminado de Mastodon) setting_default_language: El idioma de tus toots se puede detectar automáticamente, pero no siempre es correcto + setting_show_followers_count: Mostrar el número de personas que te siguen en tu perfil. Si decides no mostrarlo, quedará oculto incluso para ti, y algunas aplicaciones puede que muestren un número negativo. setting_skin: Cambia el diseño de la edición seleccionada de Mastodon labels: defaults: @@ -16,6 +17,7 @@ es-MX: setting_default_content_type_markdown: Markdown setting_default_content_type_plain: Sin formato setting_favourite_modal: Mostrar diálogo de confirmación antes de marcar como favorito (sólo aplica a la edición Glich) + setting_show_followers_count: Mostrar cuánta gente te sigue setting_skin: Diseño setting_system_emoji_font: Usar la fuente predeterminada del sistema para emojis (sólo aplica a la edición Glitch) notification_emails: diff --git a/config/locales-glitch/simple_form.es.yml b/config/locales-glitch/simple_form.es.yml index d817bc7e57087e..b14e8863dae0ff 100644 --- a/config/locales-glitch/simple_form.es.yml +++ b/config/locales-glitch/simple_form.es.yml @@ -8,6 +8,7 @@ es: setting_default_content_type_markdown: Al escribir toots, asume que estás usando Markdown para dar formato de texto enriquecido, a menos que se especifique lo contrario setting_default_content_type_plain: Al escribir toots, asume que estás usando texto sin formato, a menos que se especifique lo contrario (predeterminado de Mastodon) setting_default_language: El idioma de tus toots se puede detectar automáticamente, pero no siempre es correcto + setting_show_followers_count: Mostrar el número de personas que te siguen en tu perfil. Si decides no mostrarlo, quedará oculto incluso para ti, y algunas aplicaciones puede que muestren un número negativo. setting_skin: Cambia el diseño de la edición seleccionada de Mastodon labels: defaults: @@ -16,6 +17,7 @@ es: setting_default_content_type_markdown: Markdown setting_default_content_type_plain: Sin formato setting_favourite_modal: Mostrar diálogo de confirmación antes de marcar como favorito (sólo aplica a la edición Glich) + setting_show_followers_count: Mostrar cuánta gente te sigue setting_skin: Diseño setting_system_emoji_font: Usar la fuente predeterminada del sistema para emojis (sólo aplica a la edición Glitch) notification_emails: diff --git a/config/locales-glitch/simple_form.hi.yml b/config/locales-glitch/simple_form.hi.yml index d758a5b5357d76..dd70f6f584f6e1 100644 --- a/config/locales-glitch/simple_form.hi.yml +++ b/config/locales-glitch/simple_form.hi.yml @@ -1 +1,9 @@ +--- hi: + simple_form: + hints: + defaults: + setting_show_followers_count: आपकी प्रोफ़ाइल पर आपके अनुयायियों की संख्या दिखाएँ। यदि आप अपने अनुयायियों की संख्या छिपाते हैं, तो यह आपसे भी छिपी रहेगी, और कुछ एप्लिकेशन नकारात्मक अनुयायियों की संख्या प्रदर्शित कर सकते हैं। + labels: + defaults: + setting_show_followers_count: अपने अनुयायियों की संख्या दिखाएँ diff --git a/config/locales-glitch/simple_form.zh-TW.yml b/config/locales-glitch/simple_form.zh-TW.yml index cb82c0526113b9..114cc4ca501d62 100644 --- a/config/locales-glitch/simple_form.zh-TW.yml +++ b/config/locales-glitch/simple_form.zh-TW.yml @@ -1 +1,26 @@ +--- zh-TW: + simple_form: + glitch_only: glitch-soc + hints: + defaults: + setting_default_content_type_html: 在編寫貼文時,除非特別指定,否則應推定它們是以原始 HTML 編寫的 + setting_default_content_type_markdown: 在編寫貼文時,除非特別指定,否則應推定它們是以 Markdown 編寫的多文字格式 + setting_default_content_type_plain: 在編寫貼文時,除非特別指定,否則應推定它們是以純文字編寫的格式(Mastodon 的預設格式) + setting_default_language: 可自動檢測您的貼文所使用的語言,但並不是很可靠 + setting_show_followers_count: 在個人檔案中顯示跟隨者人數。如果您隱藏了跟隨者人數,那麼即使您自己也無法看到,某些應用程序可能會顯示負的跟隨者人數。 + setting_skin: 重塑所選的Mastodon風格 + labels: + defaults: + setting_default_content_type: 貼文的預設格式 + setting_default_content_type_html: HTML + setting_default_content_type_markdown: Markdown + setting_default_content_type_plain: 純文字 + setting_favourite_modal: 把貼文加到最愛時顯示確認對話框(只對Glitch風格有效) + setting_show_followers_count: 顯示你的跟隨者數量 + setting_skin: 外觀 + setting_system_emoji_font: 使用系統的預設字型來顯示表情符號(只對Glitch 風格有效) + notification_emails: + trending_link: 新的熱門趨勢連結需要被檢閱 + trending_status: 新的熱門趨勢貼文需要被檢閱 + trending_tag: 新的熱門趨勢主題標籤需要被檢閱 diff --git a/config/locales-glitch/zh-TW.yml b/config/locales-glitch/zh-TW.yml index 99af36c9ecc95d..735e6d56c3bf1b 100644 --- a/config/locales-glitch/zh-TW.yml +++ b/config/locales-glitch/zh-TW.yml @@ -1,9 +1,42 @@ --- zh-TW: + admin: + custom_emojis: + batch_copy_error: 複製某些選定的表情符號時出錯:%{message} + batch_error: 發生錯誤:%{message} + settings: + captcha_enabled: + desc_html: 這依賴於 hCaptcha 的外部腳本,可能會引起安全和隱私問題。此外,這會大大降低某些人(尤其是殘障人士)註冊過程的可訪問性。出於這些原因,請考慮採取其他措施,例如基於批准或邀請的註冊方式。 + title: 要求新使用者完成 CAPTCHA 挑戰以確認帳號 + flavour_and_skin: + title: 風格與外觀 + hide_followers_count: + desc_html: 不顯示用戶個人資料上的跟隨者數量 + title: 隱藏跟隨者數量 + other: + preamble: 沒有合適分類的各種glitch-soc設置。 + title: 其它 + outgoing_spoilers: + desc_html: 在聯合貼文時,將此內容警告添加到沒有內容警告的貼文中。如果您的伺服器器專門處理其他服務器可能希望在「內容警告」下顯示的內容,它將非常有用。媒體也會被標記為敏感。 + title: 針對向外發送貼文的內容警告 + show_reblogs_in_public_timelines: + desc_html: 在本地與公開時間軸顯示公開貼文的公開轉貼。 + title: 在公開時間軸顯示轉貼 + show_replies_in_public_timelines: + desc_html: 除了公開的自我回覆(討論串)以外,在本地與公開時間軸顯示公開的回覆。 + title: 在公開時間軸顯示回覆 + trending_status_cw: + desc_html: 當啟用熱門趨勢貼文時,允許包含內容警告的貼文。改變此設置並不溯及既往。 + title: 允許包含內容警告的貼文顯示在熱門趨勢。 appearance: localization: glitch_guide_link: https://crowdin.com/project/glitch-soc glitch_guide_link_text: 對於 glitch-soc 來說也是如此! auth: captcha_confirmation: + hint_html: 還差一步!為確認您的帳號,伺服器器要求您通過CAPTCHA驗證。如果您在確認帳號時有疑問或需要幫助,可以聯繫服務器管理員。 title: 使用者驗證 + generic: + use_this: 使用這個 + settings: + flavours: 風格