Rename files (11): utils

This commit is contained in:
Chewbacca 2022-11-15 15:46:23 -05:00
parent fe34af29d3
commit 637d78db01
43 changed files with 32 additions and 32 deletions

View File

@ -10,7 +10,7 @@ import { tagHistory } from 'soapbox/settings';
import { isLoggedIn } from 'soapbox/utils/auth'; import { isLoggedIn } from 'soapbox/utils/auth';
import { getFeatures, parseVersion } from 'soapbox/utils/features'; import { getFeatures, parseVersion } from 'soapbox/utils/features';
import { formatBytes, getVideoDuration } from 'soapbox/utils/media'; import { formatBytes, getVideoDuration } from 'soapbox/utils/media';
import resizeImage from 'soapbox/utils/resize_image'; import resizeImage from 'soapbox/utils/resize-image';
import { showAlert, showAlertForError } from './alerts'; import { showAlert, showAlertForError } from './alerts';
import { useEmoji } from './emojis'; import { useEmoji } from './emojis';

View File

@ -1,11 +1,11 @@
import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable';
import ConfigDB from 'soapbox/utils/config_db'; import ConfigDB from 'soapbox/utils/config-db';
import { fetchConfig, updateConfig } from './admin'; import { fetchConfig, updateConfig } from './admin';
import type { AppDispatch, RootState } from 'soapbox/store'; import type { AppDispatch, RootState } from 'soapbox/store';
import type { Policy } from 'soapbox/utils/config_db'; import type { Policy } from 'soapbox/utils/config-db';
const simplePolicyMerge = (simplePolicy: Policy, host: string, restrictions: ImmutableMap<string, any>) => { const simplePolicyMerge = (simplePolicy: Policy, host: string, restrictions: ImmutableMap<string, any>) => {
return simplePolicy.map((hosts, key) => { return simplePolicy.map((hosts, key) => {

View File

@ -1,7 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { Link, useHistory } from 'react-router-dom'; import { Link, useHistory } from 'react-router-dom';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import VerificationBadge from 'soapbox/components/verification-badge'; import VerificationBadge from 'soapbox/components/verification-badge';
import ActionButton from 'soapbox/features/ui/components/action-button'; import ActionButton from 'soapbox/features/ui/components/action-button';
import { useAppSelector, useOnScreen } from 'soapbox/hooks'; import { useAppSelector, useOnScreen } from 'soapbox/hooks';

View File

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import { useSoapboxConfig } from 'soapbox/hooks'; import { useSoapboxConfig } from 'soapbox/hooks';
import { getAcct } from '../utils/accounts'; import { getAcct } from '../utils/accounts';

View File

@ -8,7 +8,7 @@ import { openModal } from 'soapbox/actions/modals';
import EmojiSelector from 'soapbox/components/ui/emoji-selector/emoji-selector'; import EmojiSelector from 'soapbox/components/ui/emoji-selector/emoji-selector';
import { useAppSelector, useOwnAccount, useSoapboxConfig } from 'soapbox/hooks'; import { useAppSelector, useOwnAccount, useSoapboxConfig } from 'soapbox/hooks';
import { isUserTouching } from 'soapbox/is_mobile'; import { isUserTouching } from 'soapbox/is_mobile';
import { getReactForStatus } from 'soapbox/utils/emoji_reacts'; import { getReactForStatus } from 'soapbox/utils/emoji-reacts';
interface IEmojiButtonWrapper { interface IEmojiButtonWrapper {
statusId: string, statusId: string,

View File

@ -3,7 +3,7 @@ import { Helmet as ReactHelmet } from 'react-helmet';
import { useAppSelector, useSettings } from 'soapbox/hooks'; import { useAppSelector, useSettings } from 'soapbox/hooks';
import { RootState } from 'soapbox/store'; import { RootState } from 'soapbox/store';
import FaviconService from 'soapbox/utils/favicon_service'; import FaviconService from 'soapbox/utils/favicon-service';
FaviconService.initFaviconService(); FaviconService.initFaviconService();

View File

@ -10,7 +10,7 @@ import { Attachment } from 'soapbox/types/entities';
import { truncateFilename } from 'soapbox/utils/media'; import { truncateFilename } from 'soapbox/utils/media';
import { isIOS } from '../is_mobile'; import { isIOS } from '../is_mobile';
import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media_aspect_ratio'; import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio';
import type { Property } from 'csstype'; import type { Property } from 'csstype';
import type { List as ImmutableList } from 'immutable'; import type { List as ImmutableList } from 'immutable';

View File

@ -17,7 +17,7 @@ import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
import { makeGetAccount } from 'soapbox/selectors'; import { makeGetAccount } from 'soapbox/selectors';
import { isLocal } from 'soapbox/utils/accounts'; import { isLocal } from 'soapbox/utils/accounts';
import { showProfileHoverCard } from './hover_ref_wrapper'; import { showProfileHoverCard } from './hover-ref-wrapper';
import { Card, CardBody, HStack, Icon, Stack, Text } from './ui'; import { Card, CardBody, HStack, Icon, Stack, Text } from './ui';
import type { AppDispatch } from 'soapbox/store'; import type { AppDispatch } from 'soapbox/store';

View File

@ -19,7 +19,7 @@ import StatusActionButton from 'soapbox/components/status-action-button';
import DropdownMenuContainer from 'soapbox/containers/dropdown-menu-container'; import DropdownMenuContainer from 'soapbox/containers/dropdown-menu-container';
import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks'; import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks';
import { isLocal } from 'soapbox/utils/accounts'; import { isLocal } from 'soapbox/utils/accounts';
import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji_reacts'; import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji-reacts';
import type { Menu } from 'soapbox/components/dropdown-menu'; import type { Menu } from 'soapbox/components/dropdown-menu';
import type { Account, Status } from 'soapbox/types/entities'; import type { Account, Status } from 'soapbox/types/entities';

View File

@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
import { useSoapboxConfig } from 'soapbox/hooks'; import { useSoapboxConfig } from 'soapbox/hooks';
import { addGreentext } from 'soapbox/utils/greentext'; import { addGreentext } from 'soapbox/utils/greentext';
import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich_content'; import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content';
import { isRtl } from '../rtl'; import { isRtl } from '../rtl';

View File

@ -3,8 +3,8 @@ import { FormattedList, FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper'; import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper';
import { useAppDispatch } from 'soapbox/hooks'; import { useAppDispatch } from 'soapbox/hooks';
import type { Account, Status } from 'soapbox/types/entities'; import type { Account, Status } from 'soapbox/types/entities';

View File

@ -2,7 +2,7 @@ import classNames from 'clsx';
import React from 'react'; import React from 'react';
import { NavLink, useLocation } from 'react-router-dom'; import { NavLink, useLocation } from 'react-router-dom';
import IconWithCounter from 'soapbox/components/icon_with_counter'; import IconWithCounter from 'soapbox/components/icon-with-counter';
import { Icon, Text } from 'soapbox/components/ui'; import { Icon, Text } from 'soapbox/components/ui';
interface IThumbNavigationLink { interface IThumbNavigationLink {

View File

@ -6,7 +6,7 @@ import { closeReports } from 'soapbox/actions/admin';
import { deactivateUserModal, deleteUserModal } from 'soapbox/actions/moderation'; import { deactivateUserModal, deleteUserModal } from 'soapbox/actions/moderation';
import snackbar from 'soapbox/actions/snackbar'; import snackbar from 'soapbox/actions/snackbar';
import Avatar from 'soapbox/components/avatar'; import Avatar from 'soapbox/components/avatar';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import { Button, HStack } from 'soapbox/components/ui'; import { Button, HStack } from 'soapbox/components/ui';
import DropdownMenu from 'soapbox/containers/dropdown-menu-container'; import DropdownMenu from 'soapbox/containers/dropdown-menu-container';
import Accordion from 'soapbox/features/ui/components/accordion'; import Accordion from 'soapbox/features/ui/components/accordion';

View File

@ -19,7 +19,7 @@ import emojify from 'soapbox/features/emoji/emoji';
import Bundle from 'soapbox/features/ui/components/bundle'; import Bundle from 'soapbox/features/ui/components/bundle';
import { MediaGallery } from 'soapbox/features/ui/util/async-components'; import { MediaGallery } from 'soapbox/features/ui/util/async-components';
import { useAppSelector, useAppDispatch, useRefEventHandler } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch, useRefEventHandler } from 'soapbox/hooks';
import { onlyEmoji } from 'soapbox/utils/rich_content'; import { onlyEmoji } from 'soapbox/utils/rich-content';
import type { Menu } from 'soapbox/components/dropdown-menu'; import type { Menu } from 'soapbox/components/dropdown-menu';
import type { ChatMessage as ChatMessageEntity } from 'soapbox/types/entities'; import type { ChatMessage as ChatMessageEntity } from 'soapbox/types/entities';

View File

@ -6,7 +6,7 @@ import {
toggleChat, toggleChat,
} from 'soapbox/actions/chats'; } from 'soapbox/actions/chats';
import Avatar from 'soapbox/components/avatar'; import Avatar from 'soapbox/components/avatar';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import IconButton from 'soapbox/components/icon-button'; import IconButton from 'soapbox/components/icon-button';
import { HStack, Counter } from 'soapbox/components/ui'; import { HStack, Counter } from 'soapbox/components/ui';
import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks';

View File

@ -2,7 +2,7 @@ import React from 'react';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import { length } from 'stringz'; import { length } from 'stringz';
import ProgressCircle from 'soapbox/components/progress_circle'; import ProgressCircle from 'soapbox/components/progress-circle';
const messages = defineMessages({ const messages = defineMessages({
title: { id: 'compose.character_counter.title', defaultMessage: 'Used {chars} out of {maxChars} characters' }, title: { id: 'compose.character_counter.title', defaultMessage: 'Used {chars} out of {maxChars} characters' },

View File

@ -6,7 +6,7 @@ import { useLocation } from 'react-router-dom';
import { fetchDirectory, expandDirectory } from 'soapbox/actions/directory'; import { fetchDirectory, expandDirectory } from 'soapbox/actions/directory';
import LoadMore from 'soapbox/components/load-more'; import LoadMore from 'soapbox/components/load-more';
import RadioButton from 'soapbox/components/radio_button'; import RadioButton from 'soapbox/components/radio-button';
import Column from 'soapbox/features/ui/components/column'; import Column from 'soapbox/features/ui/components/column';
import { useAppSelector } from 'soapbox/hooks'; import { useAppSelector } from 'soapbox/hooks';
import { getFeatures } from 'soapbox/utils/features'; import { getFeatures } from 'soapbox/utils/features';

View File

@ -21,7 +21,7 @@ import {
import Streamfield, { StreamfieldComponent } from 'soapbox/components/ui/streamfield/streamfield'; import Streamfield, { StreamfieldComponent } from 'soapbox/components/ui/streamfield/streamfield';
import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soapbox/hooks';
import { normalizeAccount } from 'soapbox/normalizers'; import { normalizeAccount } from 'soapbox/normalizers';
import resizeImage from 'soapbox/utils/resize_image'; import resizeImage from 'soapbox/utils/resize-image';
import ProfilePreview from './components/profile-preview'; import ProfilePreview from './components/profile-preview';

View File

@ -7,7 +7,7 @@ import { patchMe } from 'soapbox/actions/me';
import snackbar from 'soapbox/actions/snackbar'; import snackbar from 'soapbox/actions/snackbar';
import { Avatar, Button, Card, CardBody, Icon, Spinner, Stack, Text } from 'soapbox/components/ui'; import { Avatar, Button, Card, CardBody, Icon, Spinner, Stack, Text } from 'soapbox/components/ui';
import { useOwnAccount } from 'soapbox/hooks'; import { useOwnAccount } from 'soapbox/hooks';
import resizeImage from 'soapbox/utils/resize_image'; import resizeImage from 'soapbox/utils/resize-image';
import type { AxiosError } from 'axios'; import type { AxiosError } from 'axios';

View File

@ -8,7 +8,7 @@ import snackbar from 'soapbox/actions/snackbar';
import StillImage from 'soapbox/components/still-image'; import StillImage from 'soapbox/components/still-image';
import { Avatar, Button, Card, CardBody, Icon, Spinner, Stack, Text } from 'soapbox/components/ui'; import { Avatar, Button, Card, CardBody, Icon, Spinner, Stack, Text } from 'soapbox/components/ui';
import { useOwnAccount } from 'soapbox/hooks'; import { useOwnAccount } from 'soapbox/hooks';
import resizeImage from 'soapbox/utils/resize_image'; import resizeImage from 'soapbox/utils/resize-image';
import type { AxiosError } from 'axios'; import type { AxiosError } from 'axios';

View File

@ -7,7 +7,7 @@ import { useDispatch } from 'react-redux';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
import { HStack, IconButton, Text, Emoji } from 'soapbox/components/ui'; import { HStack, IconButton, Text, Emoji } from 'soapbox/components/ui';
import { useAppSelector, useSoapboxConfig, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useSoapboxConfig, useFeatures } from 'soapbox/hooks';
import { reduceEmoji } from 'soapbox/utils/emoji_reacts'; import { reduceEmoji } from 'soapbox/utils/emoji-reacts';
import type { Status } from 'soapbox/types/entities'; import type { Status } from 'soapbox/types/entities';

View File

@ -6,7 +6,7 @@ import { Link } from 'react-router-dom';
import { fetchAccountFamiliarFollowers } from 'soapbox/actions/familiar_followers'; import { fetchAccountFamiliarFollowers } from 'soapbox/actions/familiar_followers';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper';
import { Text } from 'soapbox/components/ui'; import { Text } from 'soapbox/components/ui';
import VerificationBadge from 'soapbox/components/verification-badge'; import VerificationBadge from 'soapbox/components/verification-badge';
import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useFeatures } from 'soapbox/hooks';

View File

@ -7,7 +7,7 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import Blurhash from 'soapbox/components/blurhash'; import Blurhash from 'soapbox/components/blurhash';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
import { useSettings } from 'soapbox/hooks'; import { useSettings } from 'soapbox/hooks';
import { isPanoramic, isPortrait, minimumAspectRatio, maximumAspectRatio } from 'soapbox/utils/media_aspect_ratio'; import { isPanoramic, isPortrait, minimumAspectRatio, maximumAspectRatio } from 'soapbox/utils/media-aspect-ratio';
import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen'; import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';

View File

@ -25,7 +25,7 @@ import { normalizeId } from 'soapbox/utils/normalizers';
import type { AnyAction } from 'redux'; import type { AnyAction } from 'redux';
import type { APIEntity } from 'soapbox/types/entities'; import type { APIEntity } from 'soapbox/types/entities';
import type { Config } from 'soapbox/utils/config_db'; import type { Config } from 'soapbox/utils/config-db';
const ReducerRecord = ImmutableRecord({ const ReducerRecord = ImmutableRecord({
reports: ImmutableMap<string, ReducerAdminReport>(), reports: ImmutableMap<string, ReducerAdminReport>(),

View File

@ -4,7 +4,7 @@ import { ADMIN_CONFIG_UPDATE_REQUEST, ADMIN_CONFIG_UPDATE_SUCCESS } from 'soapbo
import { PLEROMA_PRELOAD_IMPORT } from 'soapbox/actions/preload'; import { PLEROMA_PRELOAD_IMPORT } from 'soapbox/actions/preload';
import { normalizeInstance } from 'soapbox/normalizers/instance'; import { normalizeInstance } from 'soapbox/normalizers/instance';
import KVStore from 'soapbox/storage/kv-store'; import KVStore from 'soapbox/storage/kv-store';
import { ConfigDB } from 'soapbox/utils/config_db'; import { ConfigDB } from 'soapbox/utils/config-db';
import { import {
rememberInstance, rememberInstance,

View File

@ -2,7 +2,7 @@ import { Map as ImmutableMap, fromJS } from 'immutable';
import { PLEROMA_PRELOAD_IMPORT } from 'soapbox/actions/preload'; import { PLEROMA_PRELOAD_IMPORT } from 'soapbox/actions/preload';
import KVStore from 'soapbox/storage/kv-store'; import KVStore from 'soapbox/storage/kv-store';
import { ConfigDB } from 'soapbox/utils/config_db'; import { ConfigDB } from 'soapbox/utils/config-db';
import { ADMIN_CONFIG_UPDATE_SUCCESS } from '../actions/admin'; import { ADMIN_CONFIG_UPDATE_SUCCESS } from '../actions/admin';
import { import {

View File

@ -3,7 +3,7 @@ import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable';
import emojify from 'soapbox/features/emoji/emoji'; import emojify from 'soapbox/features/emoji/emoji';
import { normalizeStatus } from 'soapbox/normalizers'; import { normalizeStatus } from 'soapbox/normalizers';
import { simulateEmojiReact, simulateUnEmojiReact } from 'soapbox/utils/emoji_reacts'; import { simulateEmojiReact, simulateUnEmojiReact } from 'soapbox/utils/emoji-reacts';
import { stripCompatibilityFeatures, unescapeHTML } from 'soapbox/utils/html'; import { stripCompatibilityFeatures, unescapeHTML } from 'soapbox/utils/html';
import { makeEmojiMap, normalizeId } from 'soapbox/utils/normalizers'; import { makeEmojiMap, normalizeId } from 'soapbox/utils/normalizers';

View File

@ -9,7 +9,7 @@ import { createSelector } from 'reselect';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import { getDomain } from 'soapbox/utils/accounts'; import { getDomain } from 'soapbox/utils/accounts';
import { validId } from 'soapbox/utils/auth'; import { validId } from 'soapbox/utils/auth';
import ConfigDB from 'soapbox/utils/config_db'; import ConfigDB from 'soapbox/utils/config-db';
import { shouldFilter } from 'soapbox/utils/timelines'; import { shouldFilter } from 'soapbox/utils/timelines';
import type { ReducerChat } from 'soapbox/reducers/chats'; import type { ReducerChat } from 'soapbox/reducers/chats';

View File

@ -2,7 +2,7 @@ import { List as ImmutableList, fromJS } from 'immutable';
import config_db from 'soapbox/__fixtures__/config_db.json'; import config_db from 'soapbox/__fixtures__/config_db.json';
import { ConfigDB } from '../config_db'; import { ConfigDB } from '../config-db';
test('find', () => { test('find', () => {
const configs = fromJS(config_db).get('configs'); const configs = fromJS(config_db).get('configs');

View File

@ -11,7 +11,7 @@ import {
getReactForStatus, getReactForStatus,
simulateEmojiReact, simulateEmojiReact,
simulateUnEmojiReact, simulateUnEmojiReact,
} from '../emoji_reacts'; } from '../emoji-reacts';
const ALLOWED_EMOJI = ImmutableList([ const ALLOWED_EMOJI = ImmutableList([
'👍', '👍',

View File

@ -1,4 +1,4 @@
import { processHtml } from './tiny_post_html_processor'; import { processHtml } from './tiny-post-html-processor';
export const addGreentext = (html: string): string => { export const addGreentext = (html: string): string => {
// Copied from Pleroma FE // Copied from Pleroma FE