Move more modules from flavours/glitch/utils to flavours/glitch
This commit is contained in:
parent
2535ec4fcb
commit
b75bf336bd
|
@ -3,7 +3,7 @@ import { CancelToken, isCancel } from 'axios';
|
|||
import { throttle } from 'lodash';
|
||||
import { search as emojiSearch } from 'flavours/glitch/utils/emoji/emoji_mart_search_light';
|
||||
import { useEmoji } from './emojis';
|
||||
import { tagHistory } from 'flavours/glitch/utils/settings';
|
||||
import { tagHistory } from '../settings';
|
||||
import { recoverHashtags } from 'flavours/glitch/utils/hashtag';
|
||||
import resizeImage from 'flavours/glitch/utils/resize_image';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import api from '../api';
|
||||
import { debounce } from 'lodash';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from '../compare_id';
|
||||
import { List as ImmutableList } from 'immutable';
|
||||
|
||||
export const MARKERS_FETCH_REQUEST = 'MARKERS_FETCH_REQUEST';
|
||||
|
|
|
@ -13,7 +13,7 @@ import { defineMessages } from 'react-intl';
|
|||
import { List as ImmutableList } from 'immutable';
|
||||
import { unescapeHTML } from 'flavours/glitch/utils/html';
|
||||
import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from 'flavours/glitch/compare_id';
|
||||
import { requestNotificationPermission } from 'flavours/glitch/utils/notifications';
|
||||
|
||||
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import api from '../../api';
|
||||
import { pushNotificationsSetting } from 'flavours/glitch/utils/settings';
|
||||
import { pushNotificationsSetting } from '../../settings';
|
||||
import { setBrowserSupport, setSubscription, clearSubscription } from './setter';
|
||||
|
||||
// Taken from https://www.npmjs.com/package/web-push
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// @ts-check
|
||||
|
||||
import { connectStream } from 'flavours/glitch/utils/stream';
|
||||
import { connectStream } from '../stream';
|
||||
import {
|
||||
updateTimeline,
|
||||
deleteFromTimelines,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { importFetchedStatus, importFetchedStatuses } from './importer';
|
|||
import { submitMarkers } from './markers';
|
||||
import api, { getLinks } from 'flavours/glitch/api';
|
||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from 'flavours/glitch/compare_id';
|
||||
import { me, usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
|
||||
import { toServerSideType } from 'flavours/glitch/utils/filters';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import includes from 'array-includes';
|
|||
import assign from 'object-assign';
|
||||
import values from 'object.values';
|
||||
import isNaN from 'is-nan';
|
||||
import { decode as decodeBase64 } from './base64';
|
||||
import { decode as decodeBase64 } from './utils/base64';
|
||||
import promiseFinally from 'promise.prototype.finally';
|
||||
|
||||
if (!Array.prototype.includes) {
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||
import { scrollTop } from 'flavours/glitch/utils/scroll';
|
||||
import { scrollTop } from '../scroll';
|
||||
|
||||
export default class Column extends React.PureComponent {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|||
import { is } from 'immutable';
|
||||
import IconButton from './icon_button';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import { isIOS } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isIOS } from '../is_mobile';
|
||||
import classNames from 'classnames';
|
||||
import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
|
||||
import { debounce } from 'lodash';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dro
|
|||
import { openModal, closeModal } from 'flavours/glitch/actions/modal';
|
||||
import { connect } from 'react-redux';
|
||||
import DropdownMenu from 'flavours/glitch/components/dropdown_menu';
|
||||
import { isUserTouching } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isUserTouching } from '../is_mobile';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
dropdownPlacement: state.getIn(['dropdown_menu', 'placement']),
|
||||
|
|
|
@ -2,7 +2,7 @@ import Blurhash from 'flavours/glitch/components/blurhash';
|
|||
import classNames from 'classnames';
|
||||
import Icon from 'flavours/glitch/components/icon';
|
||||
import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
|
||||
import { isIOS } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isIOS } from 'flavours/glitch/is_mobile';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
|
|
|
@ -9,7 +9,7 @@ import EmojiPicker from 'flavours/glitch/features/emoji_picker';
|
|||
import PollFormContainer from '../containers/poll_form_container';
|
||||
import UploadFormContainer from '../containers/upload_form_container';
|
||||
import WarningContainer from '../containers/warning_container';
|
||||
import { isMobile } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isMobile } from 'flavours/glitch/is_mobile';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { countableText } from '../util/counter';
|
||||
import OptionsContainer from '../containers/options_container';
|
||||
|
|
|
@ -9,7 +9,7 @@ import IconButton from 'flavours/glitch/components/icon_button';
|
|||
import DropdownMenu from './dropdown_menu';
|
||||
|
||||
// Utils.
|
||||
import { isUserTouching } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isUserTouching } from 'flavours/glitch/is_mobile';
|
||||
import { assignHandlers } from 'flavours/glitch/utils/react_helpers';
|
||||
|
||||
// The component.
|
||||
|
|
|
@ -6,7 +6,7 @@ import spring from 'react-motion/lib/spring';
|
|||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import Icon from 'flavours/glitch/components/icon';
|
||||
import { isUserTouching } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isUserTouching } from 'flavours/glitch/is_mobile';
|
||||
|
||||
export default class Upload extends ImmutablePureComponent {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import { debounce } from 'lodash';
|
|||
import ScrollableList from 'flavours/glitch/components/scrollable_list';
|
||||
import LoadGap from 'flavours/glitch/components/load_gap';
|
||||
import Icon from 'flavours/glitch/components/icon';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from 'flavours/glitch/compare_id';
|
||||
import NotificationsPermissionBanner from './components/notifications_permission_banner';
|
||||
import NotSignedInIndicator from 'flavours/glitch/components/not_signed_in_indicator';
|
||||
import { Helmet } from 'react-helmet';
|
||||
|
|
|
@ -2,8 +2,8 @@ import React from 'react';
|
|||
import ColumnHeader from './column_header';
|
||||
import PropTypes from 'prop-types';
|
||||
import { debounce } from 'lodash';
|
||||
import { scrollTop } from 'flavours/glitch/utils/scroll';
|
||||
import { isMobile } from 'flavours/glitch/utils/is_mobile';
|
||||
import { scrollTop } from 'flavours/glitch/scroll';
|
||||
import { isMobile } from 'flavours/glitch/is_mobile';
|
||||
|
||||
export default class Column extends React.PureComponent {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import ComposePanel from './compose_panel';
|
|||
import NavigationPanel from './navigation_panel';
|
||||
|
||||
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||
import { scrollRight } from 'flavours/glitch/utils/scroll';
|
||||
import { scrollRight } from 'flavours/glitch/scroll';
|
||||
|
||||
const componentMap = {
|
||||
'COMPOSE': Compose,
|
||||
|
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import { debounce } from 'lodash';
|
||||
import { isUserTouching } from 'flavours/glitch/utils/is_mobile';
|
||||
import { isUserTouching } from 'flavours/glitch/is_mobile';
|
||||
import Icon from 'flavours/glitch/components/icon';
|
||||
import NotificationsCounterIcon from './notifications_counter_icon';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import LoadingBarContainer from './containers/loading_bar_container';
|
|||
import ModalContainer from './containers/modal_container';
|
||||
import { connect } from 'react-redux';
|
||||
import { Redirect, withRouter } from 'react-router-dom';
|
||||
import { layoutFromWindow } from 'flavours/glitch/utils/is_mobile';
|
||||
import { layoutFromWindow } from 'flavours/glitch/is_mobile';
|
||||
import { debounce } from 'lodash';
|
||||
import { uploadCompose, resetCompose, changeComposeSpoilerness } from 'flavours/glitch/actions/compose';
|
||||
import { expandHomeTimeline } from 'flavours/glitch/actions/timelines';
|
||||
|
|
|
@ -4,7 +4,7 @@ import { setupBrowserNotifications } from 'flavours/glitch/actions/notifications
|
|||
import Mastodon, { store } from 'flavours/glitch/containers/mastodon';
|
||||
import ready from 'flavours/glitch/ready';
|
||||
|
||||
const perf = require('flavours/glitch/utils/performance');
|
||||
const perf = require('flavours/glitch/performance');
|
||||
|
||||
/**
|
||||
* @returns {Promise<void>}
|
|
@ -1,5 +1,5 @@
|
|||
import 'packs/public-path';
|
||||
import loadPolyfills from 'flavours/glitch/utils/load_polyfills';
|
||||
import loadPolyfills from 'flavours/glitch/load_polyfills';
|
||||
|
||||
function loaded() {
|
||||
const TimelineContainer = require('flavours/glitch/containers/timeline_container').default;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'packs/public-path';
|
||||
import loadPolyfills from 'flavours/glitch/utils/load_polyfills';
|
||||
import loadPolyfills from 'flavours/glitch/load_polyfills';
|
||||
|
||||
loadPolyfills().then(async () => {
|
||||
const { default: main } = await import('flavours/glitch/utils/main');
|
||||
const { default: main } = await import('flavours/glitch/main');
|
||||
|
||||
return main();
|
||||
}).catch(e => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'packs/public-path';
|
||||
import loadPolyfills from 'flavours/glitch/utils/load_polyfills';
|
||||
import loadPolyfills from 'flavours/glitch/load_polyfills';
|
||||
import ready from 'flavours/glitch/ready';
|
||||
import loadKeyboardExtensions from 'flavours/glitch/utils/load_keyboard_extensions';
|
||||
import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions';
|
||||
|
||||
function main() {
|
||||
const IntlMessageFormat = require('intl-messageformat').default;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'packs/public-path';
|
||||
import loadPolyfills from 'flavours/glitch/utils/load_polyfills';
|
||||
import loadPolyfills from 'flavours/glitch/load_polyfills';
|
||||
import ready from 'flavours/glitch/ready';
|
||||
import loadKeyboardExtensions from 'flavours/glitch/utils/load_keyboard_extensions';
|
||||
import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions';
|
||||
import 'cocoon-js-vanilla';
|
||||
|
||||
function main() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'packs/public-path';
|
||||
import loadPolyfills from 'flavours/glitch/utils/load_polyfills';
|
||||
import loadPolyfills from 'flavours/glitch/load_polyfills';
|
||||
|
||||
function loaded() {
|
||||
const ComposeContainer = require('flavours/glitch/containers/compose_container').default;
|
||||
|
|
|
@ -53,7 +53,7 @@ import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines';
|
|||
import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
|
||||
import { REDRAFT } from 'flavours/glitch/actions/statuses';
|
||||
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
|
||||
import uuid from 'flavours/glitch/utils/uuid';
|
||||
import uuid from '../uuid';
|
||||
import { privacyPreference } from 'flavours/glitch/utils/privacy_preference';
|
||||
import { me, defaultContentType } from 'flavours/glitch/initial_state';
|
||||
import { overwrite } from 'flavours/glitch/utils/js_helpers';
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
import { CONTEXT_FETCH_SUCCESS } from 'flavours/glitch/actions/statuses';
|
||||
import { TIMELINE_DELETE, TIMELINE_UPDATE } from 'flavours/glitch/actions/timelines';
|
||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from '../compare_id';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
inReplyTos: ImmutableMap(),
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from '../actions/conversations';
|
||||
import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS } from 'flavours/glitch/actions/accounts';
|
||||
import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from '../compare_id';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
items: ImmutableList(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
|
||||
import { APP_LAYOUT_CHANGE } from 'flavours/glitch/actions/app';
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
import { layoutFromWindow } from 'flavours/glitch/utils/is_mobile';
|
||||
import { layoutFromWindow } from 'flavours/glitch/is_mobile';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
streaming_api_base_url: null,
|
||||
|
|
|
@ -32,7 +32,7 @@ import {
|
|||
import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks';
|
||||
import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from 'flavours/glitch/actions/timelines';
|
||||
import { fromJS, Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from '../compare_id';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
pendingItems: ImmutableList(),
|
||||
|
|
|
@ -6,7 +6,7 @@ import { EMOJI_USE } from 'flavours/glitch/actions/emojis';
|
|||
import { LANGUAGE_USE } from 'flavours/glitch/actions/languages';
|
||||
import { LIST_DELETE_SUCCESS, LIST_FETCH_FAIL } from '../actions/lists';
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||
import uuid from 'flavours/glitch/utils/uuid';
|
||||
import uuid from '../uuid';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
saved: true,
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
ACCOUNT_UNFOLLOW_SUCCESS,
|
||||
} from 'flavours/glitch/actions/accounts';
|
||||
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
|
||||
import compareId from 'flavours/glitch/utils/compare_id';
|
||||
import compareId from '../compare_id';
|
||||
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
|
|
Loading…
Reference in New Issue