Prefer import type
when importing types
This commit is contained in:
parent
0f635af8a9
commit
74fde10ff5
721 changed files with 2037 additions and 1947 deletions
|
@ -129,6 +129,8 @@ const typescriptRules = {
|
||||||
// Upgrade from a warning
|
// Upgrade from a warning
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
||||||
|
|
||||||
|
'@typescript-eslint/consistent-type-imports': 'error',
|
||||||
|
|
||||||
// Already enforced by TypeScript
|
// Already enforced by TypeScript
|
||||||
'consistent-return': 'off',
|
'consistent-return': 'off',
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,14 +2,8 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import {
|
import type { BrowserWindow, NativeImage } from 'electron';
|
||||||
BrowserWindow,
|
import { Menu, Tray, app, nativeImage } from 'electron';
|
||||||
Menu,
|
|
||||||
NativeImage,
|
|
||||||
Tray,
|
|
||||||
app,
|
|
||||||
nativeImage,
|
|
||||||
} from 'electron';
|
|
||||||
import * as log from '../ts/logging/log';
|
import * as log from '../ts/logging/log';
|
||||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { app, dialog, clipboard } from 'electron';
|
||||||
|
|
||||||
import * as Errors from '../ts/types/errors';
|
import * as Errors from '../ts/types/errors';
|
||||||
import { redactAll } from '../ts/util/privacy';
|
import { redactAll } from '../ts/util/privacy';
|
||||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify';
|
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify';
|
||||||
|
|
||||||
// We use hard-coded strings until we're able to update these strings from the locale.
|
// We use hard-coded strings until we're able to update these strings from the locale.
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { readFileSync } from 'fs';
|
||||||
import { merge } from 'lodash';
|
import { merge } from 'lodash';
|
||||||
import { setupI18n } from '../ts/util/setupI18n';
|
import { setupI18n } from '../ts/util/setupI18n';
|
||||||
|
|
||||||
import { LoggerType } from '../ts/types/Logging';
|
import type { LoggerType } from '../ts/types/Logging';
|
||||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||||
import { LocalizerType } from '../ts/types/Util';
|
import type { LocalizerType } from '../ts/types/Util';
|
||||||
|
|
||||||
function normalizeLocaleName(locale: string): string {
|
function normalizeLocaleName(locale: string): string {
|
||||||
if (/^en-/.test(locale)) {
|
if (/^en-/.test(locale)) {
|
||||||
|
|
|
@ -34,7 +34,8 @@ import { consoleLogger } from '../ts/util/consoleLogger';
|
||||||
|
|
||||||
import './startup_config';
|
import './startup_config';
|
||||||
|
|
||||||
import config, { ConfigType } from './config';
|
import type { ConfigType } from './config';
|
||||||
|
import config from './config';
|
||||||
import {
|
import {
|
||||||
Environment,
|
Environment,
|
||||||
getEnvironment,
|
getEnvironment,
|
||||||
|
@ -63,7 +64,8 @@ import * as logging from '../ts/logging/main_process_logging';
|
||||||
import { MainSQL } from '../ts/sql/main';
|
import { MainSQL } from '../ts/sql/main';
|
||||||
import * as sqlChannels from './sql_channel';
|
import * as sqlChannels from './sql_channel';
|
||||||
import * as windowState from './window_state';
|
import * as windowState from './window_state';
|
||||||
import { createTemplate, MenuOptionsType } from './menu';
|
import type { MenuOptionsType } from './menu';
|
||||||
|
import { createTemplate } from './menu';
|
||||||
import { installFileHandler, installWebHandler } from './protocol_filter';
|
import { installFileHandler, installWebHandler } from './protocol_filter';
|
||||||
import * as OS from '../ts/OS';
|
import * as OS from '../ts/OS';
|
||||||
import { isProduction } from '../ts/util/version';
|
import { isProduction } from '../ts/util/version';
|
||||||
|
@ -87,7 +89,8 @@ import { SettingsChannel } from '../ts/main/settingsChannel';
|
||||||
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url';
|
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url';
|
||||||
import { getHeicConverter } from '../ts/workers/heicConverterMain';
|
import { getHeicConverter } from '../ts/workers/heicConverterMain';
|
||||||
|
|
||||||
import { load as loadLocale, LocaleType } from './locale';
|
import type { LocaleType } from './locale';
|
||||||
|
import { load as loadLocale } from './locale';
|
||||||
|
|
||||||
import type { LoggerType } from '../ts/types/Logging';
|
import type { LoggerType } from '../ts/types/Logging';
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { isString } from 'lodash';
|
import { isString } from 'lodash';
|
||||||
import { MenuItemConstructorOptions } from 'electron';
|
import type { MenuItemConstructorOptions } from 'electron';
|
||||||
|
|
||||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||||
|
|
||||||
export type MenuListType = Array<MenuItemConstructorOptions>;
|
export type MenuListType = Array<MenuItemConstructorOptions>;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// The list of permissions is here:
|
// The list of permissions is here:
|
||||||
// https://electronjs.org/docs/api/session#sessetpermissionrequesthandlerhandler
|
// https://electronjs.org/docs/api/session#sessetpermissionrequesthandlerhandler
|
||||||
|
|
||||||
import { session as ElectronSession } from 'electron';
|
import type { session as ElectronSession } from 'electron';
|
||||||
|
|
||||||
import type { ConfigType } from './base_config';
|
import type { ConfigType } from './base_config';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2020 Signal Messenger, LLC
|
// Copyright 2018-2020 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import {
|
import type {
|
||||||
protocol as ElectronProtocol,
|
protocol as ElectronProtocol,
|
||||||
ProtocolRequest,
|
ProtocolRequest,
|
||||||
ProtocolResponse,
|
ProtocolResponse,
|
||||||
|
|
|
@ -3,15 +3,16 @@
|
||||||
|
|
||||||
/* eslint-disable strict */
|
/* eslint-disable strict */
|
||||||
|
|
||||||
import { BrowserWindow, Menu, clipboard, nativeImage } from 'electron';
|
import type { BrowserWindow } from 'electron';
|
||||||
|
import { Menu, clipboard, nativeImage } from 'electron';
|
||||||
import { sync as osLocaleSync } from 'os-locale';
|
import { sync as osLocaleSync } from 'os-locale';
|
||||||
import { uniq } from 'lodash';
|
import { uniq } from 'lodash';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
import { maybeParseUrl } from '../ts/util/url';
|
import { maybeParseUrl } from '../ts/util/url';
|
||||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||||
|
|
||||||
import { MenuListType } from './menu';
|
import type { MenuListType } from './menu';
|
||||||
|
|
||||||
export function getLanguages(
|
export function getLanguages(
|
||||||
userLocale: string,
|
userLocale: string,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { FileWithPath } from 'react-dropzone';
|
import type { FileWithPath } from 'react-dropzone';
|
||||||
import { AppStage } from './AppStage';
|
import { AppStage } from './AppStage';
|
||||||
import * as styles from './MetaStage.scss';
|
import * as styles from './MetaStage.scss';
|
||||||
import { processStickerImage } from '../../util/preload';
|
import { processStickerImage } from '../../util/preload';
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import * as styles from './ConfirmModal.scss';
|
import * as styles from './ConfirmModal.scss';
|
||||||
import { ConfirmDialog, Props } from '../elements/ConfirmDialog';
|
import type { Props } from '../elements/ConfirmDialog';
|
||||||
|
import { ConfirmDialog } from '../elements/ConfirmDialog';
|
||||||
|
|
||||||
export type Mode = 'removable' | 'pick-emoji' | 'add';
|
export type Mode = 'removable' | 'pick-emoji' | 'add';
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,15 @@ import {
|
||||||
Reference as PopperReference,
|
Reference as PopperReference,
|
||||||
} from 'react-popper';
|
} from 'react-popper';
|
||||||
import { AddEmoji } from '../elements/icons';
|
import { AddEmoji } from '../elements/icons';
|
||||||
import { DropZone, Props as DropZoneProps } from '../elements/DropZone';
|
import type { Props as DropZoneProps } from '../elements/DropZone';
|
||||||
|
import { DropZone } from '../elements/DropZone';
|
||||||
import { StickerPreview } from '../elements/StickerPreview';
|
import { StickerPreview } from '../elements/StickerPreview';
|
||||||
import * as styles from './StickerFrame.scss';
|
import * as styles from './StickerFrame.scss';
|
||||||
import {
|
import type {
|
||||||
EmojiPickDataType,
|
EmojiPickDataType,
|
||||||
EmojiPicker,
|
|
||||||
Props as EmojiPickerProps,
|
Props as EmojiPickerProps,
|
||||||
} from '../../ts/components/emoji/EmojiPicker';
|
} from '../../ts/components/emoji/EmojiPicker';
|
||||||
|
import { EmojiPicker } from '../../ts/components/emoji/EmojiPicker';
|
||||||
import { Emoji } from '../../ts/components/emoji/Emoji';
|
import { Emoji } from '../../ts/components/emoji/Emoji';
|
||||||
import { PopperRootContext } from '../../ts/components/PopperRootContext';
|
import { PopperRootContext } from '../../ts/components/PopperRootContext';
|
||||||
import { useI18n } from '../util/i18n';
|
import { useI18n } from '../util/i18n';
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import PQueue from 'p-queue';
|
import PQueue from 'p-queue';
|
||||||
import {
|
import type { SortEndHandler } from 'react-sortable-hoc';
|
||||||
SortableContainer,
|
import { SortableContainer, SortableElement } from 'react-sortable-hoc';
|
||||||
SortableElement,
|
|
||||||
SortEndHandler,
|
|
||||||
} from 'react-sortable-hoc';
|
|
||||||
import * as styles from './StickerGrid.scss';
|
import * as styles from './StickerGrid.scss';
|
||||||
import { Props as StickerFrameProps, StickerFrame } from './StickerFrame';
|
import type { Props as StickerFrameProps } from './StickerFrame';
|
||||||
|
import { StickerFrame } from './StickerFrame';
|
||||||
import { stickersDuck } from '../store';
|
import { stickersDuck } from '../store';
|
||||||
import { DropZone, Props as DropZoneProps } from '../elements/DropZone';
|
import type { Props as DropZoneProps } from '../elements/DropZone';
|
||||||
|
import { DropZone } from '../elements/DropZone';
|
||||||
import { processStickerImage } from '../util/preload';
|
import { processStickerImage } from '../util/preload';
|
||||||
import { useI18n } from '../util/i18n';
|
import { useI18n } from '../util/i18n';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { FileWithPath } from 'react-dropzone';
|
import type { FileWithPath } from 'react-dropzone';
|
||||||
import * as styles from './DropZone.scss';
|
import * as styles from './DropZone.scss';
|
||||||
import { useI18n } from '../util/i18n';
|
import { useI18n } from '../util/i18n';
|
||||||
import { useStickerDropzone } from '../util/useStickerDropzone';
|
import { useStickerDropzone } from '../util/useStickerDropzone';
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as styles from './MessageBubble.scss';
|
import * as styles from './MessageBubble.scss';
|
||||||
import { MessageMeta, Props as MessageMetaProps } from './MessageMeta';
|
import type { Props as MessageMetaProps } from './MessageMeta';
|
||||||
|
import { MessageMeta } from './MessageMeta';
|
||||||
|
|
||||||
export type Props = Pick<MessageMetaProps, 'minutesAgo'> & {
|
export type Props = Pick<MessageMetaProps, 'minutesAgo'> & {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as styles from './MessageSticker.scss';
|
import * as styles from './MessageSticker.scss';
|
||||||
import { MessageMeta, Props as MessageMetaProps } from './MessageMeta';
|
import type { Props as MessageMetaProps } from './MessageMeta';
|
||||||
|
import { MessageMeta } from './MessageMeta';
|
||||||
|
|
||||||
export type Props = MessageMetaProps & {
|
export type Props = MessageMetaProps & {
|
||||||
image: string;
|
image: string;
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { PopperArrowProps } from 'react-popper';
|
import type { PopperArrowProps } from 'react-popper';
|
||||||
import { Placement } from '@popperjs/core';
|
import type { Placement } from '@popperjs/core';
|
||||||
import * as styles from './StickerPreview.scss';
|
import * as styles from './StickerPreview.scss';
|
||||||
import { MessageBubble } from './MessageBubble';
|
import { MessageBubble } from './MessageBubble';
|
||||||
import { MessageSticker, Props as MessageStickerProps } from './MessageSticker';
|
import type { Props as MessageStickerProps } from './MessageSticker';
|
||||||
|
import { MessageSticker } from './MessageSticker';
|
||||||
import { useI18n } from '../util/i18n';
|
import { useI18n } from '../util/i18n';
|
||||||
|
|
||||||
export type Props = Pick<React.HTMLProps<HTMLDivElement>, 'style'> & {
|
export type Props = Pick<React.HTMLProps<HTMLDivElement>, 'style'> & {
|
||||||
|
|
|
@ -4,26 +4,22 @@
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
|
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import {
|
import type { Draft } from 'redux-ts-utils';
|
||||||
createAction,
|
import { createAction, handleAction, reduceReducers } from 'redux-ts-utils';
|
||||||
Draft,
|
|
||||||
handleAction,
|
|
||||||
reduceReducers,
|
|
||||||
} from 'redux-ts-utils';
|
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { clamp, find, isNumber, pull, remove, take, uniq } from 'lodash';
|
import { clamp, find, isNumber, pull, remove, take, uniq } from 'lodash';
|
||||||
import { SortEnd } from 'react-sortable-hoc';
|
import type { SortEnd } from 'react-sortable-hoc';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import arrayMove from 'array-move';
|
import arrayMove from 'array-move';
|
||||||
// eslint-disable-next-line import/no-cycle
|
// eslint-disable-next-line import/no-cycle
|
||||||
import { AppState } from '../reducer';
|
import type { AppState } from '../reducer';
|
||||||
import {
|
import type {
|
||||||
PackMetaData,
|
PackMetaData,
|
||||||
StickerImageData,
|
StickerImageData,
|
||||||
StickerData,
|
StickerData,
|
||||||
} from '../../util/preload';
|
} from '../../util/preload';
|
||||||
import { EmojiPickDataType } from '../../../ts/components/emoji/EmojiPicker';
|
import type { EmojiPickDataType } from '../../../ts/components/emoji/EmojiPicker';
|
||||||
import { convertShortName } from '../../../ts/components/emoji/lib';
|
import { convertShortName } from '../../../ts/components/emoji/lib';
|
||||||
|
|
||||||
export const initializeStickers = createAction<Array<string>>(
|
export const initializeStickers = createAction<Array<string>>(
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2019-2020 Signal Messenger, LLC
|
// Copyright 2019-2020 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { combineReducers, Reducer } from 'redux';
|
import type { Reducer } from 'redux';
|
||||||
|
import { combineReducers } from 'redux';
|
||||||
// eslint-disable-next-line import/no-cycle
|
// eslint-disable-next-line import/no-cycle
|
||||||
import { reducer as stickers } from './ducks/stickers';
|
import { reducer as stickers } from './ducks/stickers';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2019-2021 Signal Messenger, LLC
|
// Copyright 2019-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { Metadata } from 'sharp';
|
import type { Metadata } from 'sharp';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// We want to extend `window`'s properties, so we need an interface.
|
// We want to extend `window`'s properties, so we need an interface.
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2020 Signal Messenger, LLC
|
// Copyright 2020 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { useDropzone, DropzoneOptions } from 'react-dropzone';
|
import type { DropzoneOptions } from 'react-dropzone';
|
||||||
|
import { useDropzone } from 'react-dropzone';
|
||||||
|
|
||||||
export const useStickerDropzone = (
|
export const useStickerDropzone = (
|
||||||
onDrop: DropzoneOptions['onDrop']
|
onDrop: DropzoneOptions['onDrop']
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { debounce, uniq, without } from 'lodash';
|
||||||
import PQueue from 'p-queue';
|
import PQueue from 'p-queue';
|
||||||
|
|
||||||
import dataInterface from './sql/Client';
|
import dataInterface from './sql/Client';
|
||||||
import {
|
import type {
|
||||||
ConversationModelCollectionType,
|
ConversationModelCollectionType,
|
||||||
ConversationAttributesType,
|
ConversationAttributesType,
|
||||||
ConversationAttributesTypeType,
|
ConversationAttributesTypeType,
|
||||||
} from './model-types.d';
|
} from './model-types.d';
|
||||||
import { ConversationModel } from './models/conversations';
|
import type { ConversationModel } from './models/conversations';
|
||||||
import { maybeDeriveGroupV2Id } from './groups';
|
import { maybeDeriveGroupV2Id } from './groups';
|
||||||
import { assert } from './util/assert';
|
import { assert } from './util/assert';
|
||||||
import { isValidGuid } from './util/isValidGuid';
|
import { isValidGuid } from './util/isValidGuid';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import * as client from '@signalapp/signal-client';
|
||||||
|
|
||||||
import * as Bytes from './Bytes';
|
import * as Bytes from './Bytes';
|
||||||
import { constantTimeEqual } from './Crypto';
|
import { constantTimeEqual } from './Crypto';
|
||||||
import {
|
import type {
|
||||||
KeyPairType,
|
KeyPairType,
|
||||||
CompatPreKeyType,
|
CompatPreKeyType,
|
||||||
CompatSignedPreKeyType,
|
CompatSignedPreKeyType,
|
||||||
|
|
|
@ -6,28 +6,30 @@
|
||||||
|
|
||||||
import { isNumber } from 'lodash';
|
import { isNumber } from 'lodash';
|
||||||
|
|
||||||
import {
|
import type {
|
||||||
Direction,
|
Direction,
|
||||||
IdentityKeyStore,
|
|
||||||
PreKeyRecord,
|
PreKeyRecord,
|
||||||
|
ProtocolAddress,
|
||||||
|
SenderKeyRecord,
|
||||||
|
SessionRecord,
|
||||||
|
SignedPreKeyRecord,
|
||||||
|
Uuid,
|
||||||
|
} from '@signalapp/signal-client';
|
||||||
|
import {
|
||||||
|
IdentityKeyStore,
|
||||||
PreKeyStore,
|
PreKeyStore,
|
||||||
PrivateKey,
|
PrivateKey,
|
||||||
ProtocolAddress,
|
|
||||||
PublicKey,
|
PublicKey,
|
||||||
SenderKeyRecord,
|
|
||||||
SenderKeyStore,
|
SenderKeyStore,
|
||||||
SessionRecord,
|
|
||||||
SessionStore,
|
SessionStore,
|
||||||
SignedPreKeyRecord,
|
|
||||||
SignedPreKeyStore,
|
SignedPreKeyStore,
|
||||||
Uuid,
|
|
||||||
} from '@signalapp/signal-client';
|
} from '@signalapp/signal-client';
|
||||||
import { freezePreKey, freezeSignedPreKey } from './SignalProtocolStore';
|
import { freezePreKey, freezeSignedPreKey } from './SignalProtocolStore';
|
||||||
import { Address } from './types/Address';
|
import { Address } from './types/Address';
|
||||||
import { QualifiedAddress } from './types/QualifiedAddress';
|
import { QualifiedAddress } from './types/QualifiedAddress';
|
||||||
import type { UUID } from './types/UUID';
|
import type { UUID } from './types/UUID';
|
||||||
|
|
||||||
import { Zone } from './util/Zone';
|
import type { Zone } from './util/Zone';
|
||||||
|
|
||||||
function encodeAddress(address: ProtocolAddress): Address {
|
function encodeAddress(address: ProtocolAddress): Address {
|
||||||
const name = address.name();
|
const name = address.name();
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
sessionRecordToProtobuf,
|
sessionRecordToProtobuf,
|
||||||
sessionStructureToBytes,
|
sessionStructureToBytes,
|
||||||
} from './util/sessionTranslation';
|
} from './util/sessionTranslation';
|
||||||
import {
|
import type {
|
||||||
DeviceType,
|
DeviceType,
|
||||||
IdentityKeyType,
|
IdentityKeyType,
|
||||||
IdentityKeyIdType,
|
IdentityKeyIdType,
|
||||||
|
@ -48,12 +48,11 @@ import {
|
||||||
} from './textsecure/Types.d';
|
} from './textsecure/Types.d';
|
||||||
import { getSendOptions } from './util/getSendOptions';
|
import { getSendOptions } from './util/getSendOptions';
|
||||||
import type { RemoveAllConfiguration } from './types/RemoveAllConfiguration';
|
import type { RemoveAllConfiguration } from './types/RemoveAllConfiguration';
|
||||||
import { UUID, UUIDStringType } from './types/UUID';
|
import type { UUIDStringType } from './types/UUID';
|
||||||
import { Address } from './types/Address';
|
import { UUID } from './types/UUID';
|
||||||
import {
|
import type { Address } from './types/Address';
|
||||||
QualifiedAddress,
|
import type { QualifiedAddressStringType } from './types/QualifiedAddress';
|
||||||
QualifiedAddressStringType,
|
import { QualifiedAddress } from './types/QualifiedAddress';
|
||||||
} from './types/QualifiedAddress';
|
|
||||||
import * as log from './logging/log';
|
import * as log from './logging/log';
|
||||||
|
|
||||||
const TIMESTAMP_THRESHOLD = 5 * 1000; // 5 seconds
|
const TIMESTAMP_THRESHOLD = 5 * 1000; // 5 seconds
|
||||||
|
|
|
@ -7,19 +7,22 @@ import { bindActionCreators } from 'redux';
|
||||||
import { render, unstable_batchedUpdates as batchedUpdates } from 'react-dom';
|
import { render, unstable_batchedUpdates as batchedUpdates } from 'react-dom';
|
||||||
|
|
||||||
import MessageReceiver from './textsecure/MessageReceiver';
|
import MessageReceiver from './textsecure/MessageReceiver';
|
||||||
import { SessionResetsType, ProcessedDataMessage } from './textsecure/Types.d';
|
import type {
|
||||||
|
SessionResetsType,
|
||||||
|
ProcessedDataMessage,
|
||||||
|
} from './textsecure/Types.d';
|
||||||
import { HTTPError } from './textsecure/Errors';
|
import { HTTPError } from './textsecure/Errors';
|
||||||
import {
|
import {
|
||||||
suspendTasksWithTimeout,
|
suspendTasksWithTimeout,
|
||||||
resumeTasksWithTimeout,
|
resumeTasksWithTimeout,
|
||||||
} from './textsecure/TaskWithTimeout';
|
} from './textsecure/TaskWithTimeout';
|
||||||
import {
|
import type {
|
||||||
MessageAttributesType,
|
MessageAttributesType,
|
||||||
ConversationAttributesType,
|
ConversationAttributesType,
|
||||||
} from './model-types.d';
|
} from './model-types.d';
|
||||||
import * as Bytes from './Bytes';
|
import * as Bytes from './Bytes';
|
||||||
import * as Timers from './Timers';
|
import * as Timers from './Timers';
|
||||||
import { WhatIsThis, DeliveryReceiptBatcherItemType } from './window.d';
|
import type { WhatIsThis, DeliveryReceiptBatcherItemType } from './window.d';
|
||||||
import { getTitleBarVisibility, TitleBarVisibility } from './types/Settings';
|
import { getTitleBarVisibility, TitleBarVisibility } from './types/Settings';
|
||||||
import { SocketStatus } from './types/SocketStatus';
|
import { SocketStatus } from './types/SocketStatus';
|
||||||
import { DEFAULT_CONVERSATION_COLOR } from './types/Colors';
|
import { DEFAULT_CONVERSATION_COLOR } from './types/Colors';
|
||||||
|
@ -38,7 +41,7 @@ import * as KeyboardLayout from './services/keyboardLayout';
|
||||||
import { routineProfileRefresh } from './routineProfileRefresh';
|
import { routineProfileRefresh } from './routineProfileRefresh';
|
||||||
import { isMoreRecentThan, isOlderThan, toDayMillis } from './util/timestamp';
|
import { isMoreRecentThan, isOlderThan, toDayMillis } from './util/timestamp';
|
||||||
import { isValidReactionEmoji } from './reactions/isValidReactionEmoji';
|
import { isValidReactionEmoji } from './reactions/isValidReactionEmoji';
|
||||||
import { ConversationModel } from './models/conversations';
|
import type { ConversationModel } from './models/conversations';
|
||||||
import { getMessageById } from './messages/getMessageById';
|
import { getMessageById } from './messages/getMessageById';
|
||||||
import { createBatcher } from './util/batcher';
|
import { createBatcher } from './util/batcher';
|
||||||
import { updateConversationsWithUuidLookup } from './updateConversationsWithUuidLookup';
|
import { updateConversationsWithUuidLookup } from './updateConversationsWithUuidLookup';
|
||||||
|
@ -50,7 +53,7 @@ import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey'
|
||||||
import { LatestQueue } from './util/LatestQueue';
|
import { LatestQueue } from './util/LatestQueue';
|
||||||
import { parseIntOrThrow } from './util/parseIntOrThrow';
|
import { parseIntOrThrow } from './util/parseIntOrThrow';
|
||||||
import { getProfile } from './util/getProfile';
|
import { getProfile } from './util/getProfile';
|
||||||
import {
|
import type {
|
||||||
ConfigurationEvent,
|
ConfigurationEvent,
|
||||||
ContactEvent,
|
ContactEvent,
|
||||||
DecryptionErrorEvent,
|
DecryptionErrorEvent,
|
||||||
|
@ -71,11 +74,11 @@ import {
|
||||||
SentEventData,
|
SentEventData,
|
||||||
StickerPackEvent,
|
StickerPackEvent,
|
||||||
TypingEvent,
|
TypingEvent,
|
||||||
VerifiedEvent,
|
|
||||||
ViewEvent,
|
ViewEvent,
|
||||||
ViewOnceOpenSyncEvent,
|
ViewOnceOpenSyncEvent,
|
||||||
ViewSyncEvent,
|
ViewSyncEvent,
|
||||||
} from './textsecure/messageReceiverEvents';
|
} from './textsecure/messageReceiverEvents';
|
||||||
|
import { VerifiedEvent } from './textsecure/messageReceiverEvents';
|
||||||
import type { WebAPIType } from './textsecure/WebAPI';
|
import type { WebAPIType } from './textsecure/WebAPI';
|
||||||
import * as KeyChangeListener from './textsecure/KeyChangeListener';
|
import * as KeyChangeListener from './textsecure/KeyChangeListener';
|
||||||
import { isDirectConversation, isGroupV2 } from './util/whatTypeOfConversation';
|
import { isDirectConversation, isGroupV2 } from './util/whatTypeOfConversation';
|
||||||
|
@ -96,10 +99,8 @@ import { ReadSyncs } from './messageModifiers/ReadSyncs';
|
||||||
import { ViewSyncs } from './messageModifiers/ViewSyncs';
|
import { ViewSyncs } from './messageModifiers/ViewSyncs';
|
||||||
import { ViewOnceOpenSyncs } from './messageModifiers/ViewOnceOpenSyncs';
|
import { ViewOnceOpenSyncs } from './messageModifiers/ViewOnceOpenSyncs';
|
||||||
import { ReadStatus } from './messages/MessageReadStatus';
|
import { ReadStatus } from './messages/MessageReadStatus';
|
||||||
import {
|
import type { SendStateByConversationId } from './messages/MessageSendState';
|
||||||
SendStateByConversationId,
|
import { SendStatus } from './messages/MessageSendState';
|
||||||
SendStatus,
|
|
||||||
} from './messages/MessageSendState';
|
|
||||||
import * as AttachmentDownloads from './messageModifiers/AttachmentDownloads';
|
import * as AttachmentDownloads from './messageModifiers/AttachmentDownloads';
|
||||||
import * as preferredReactions from './state/ducks/preferredReactions';
|
import * as preferredReactions from './state/ducks/preferredReactions';
|
||||||
import * as Conversation from './types/Conversation';
|
import * as Conversation from './types/Conversation';
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
// are not immediately retried, however, until `.onOnline()` is called from
|
// are not immediately retried, however, until `.onOnline()` is called from
|
||||||
// when we are actually online.
|
// when we are actually online.
|
||||||
|
|
||||||
import { MessageModel } from './models/messages';
|
import type { MessageModel } from './models/messages';
|
||||||
import { assert } from './util/assert';
|
import { assert } from './util/assert';
|
||||||
import { isNotNil } from './util/isNotNil';
|
import { isNotNil } from './util/isNotNil';
|
||||||
import { isOlderThan } from './util/timestamp';
|
import { isOlderThan } from './util/timestamp';
|
||||||
import { parseRetryAfter } from './util/parseRetryAfter';
|
import { parseRetryAfter } from './util/parseRetryAfter';
|
||||||
import { getEnvironment, Environment } from './environment';
|
import { getEnvironment, Environment } from './environment';
|
||||||
import { StorageInterface } from './types/Storage.d';
|
import type { StorageInterface } from './types/Storage.d';
|
||||||
import { HTTPError } from './textsecure/Errors';
|
import { HTTPError } from './textsecure/Errors';
|
||||||
import * as log from './logging/log';
|
import * as log from './logging/log';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { useEscapeHandling } from '../hooks/useEscapeHandling';
|
import { useEscapeHandling } from '../hooks/useEscapeHandling';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { FunctionComponent, ReactNode } from 'react';
|
import type { FunctionComponent, ReactNode } from 'react';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Alert } from './Alert';
|
import { Alert } from './Alert';
|
||||||
import { Intl } from './Intl';
|
import { Intl } from './Intl';
|
||||||
import { ContactName } from './conversation/ContactName';
|
import { ContactName } from './conversation/ContactName';
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { FunctionComponent, ReactNode } from 'react';
|
import type { FunctionComponent, ReactNode } from 'react';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Button } from './Button';
|
import { Button } from './Button';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { Intl } from './Intl';
|
import { Intl } from './Intl';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
import { ConversationListItem } from './conversationList/ConversationListItem';
|
import { ConversationListItem } from './conversationList/ConversationListItem';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { ComponentProps, useEffect } from 'react';
|
import type { ComponentProps } from 'react';
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
import { Globals } from '@react-spring/web';
|
import { Globals } from '@react-spring/web';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,12 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { boolean, select, text } from '@storybook/addon-knobs';
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { Avatar, AvatarBlur, Props } from './Avatar';
|
import type { Props } from './Avatar';
|
||||||
|
import { Avatar, AvatarBlur } from './Avatar';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
import { AvatarColors } from '../types/Colors';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
// Copyright 2018-2021 Signal Messenger, LLC
|
// Copyright 2018-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, {
|
import type {
|
||||||
FunctionComponent,
|
FunctionComponent,
|
||||||
MouseEvent,
|
MouseEvent,
|
||||||
ReactChild,
|
ReactChild,
|
||||||
ReactNode,
|
ReactNode,
|
||||||
useEffect,
|
|
||||||
useState,
|
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
|
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
|
|
||||||
import { getInitials } from '../util/getInitials';
|
import { getInitials } from '../util/getInitials';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import * as log from '../logging/log';
|
import * as log from '../logging/log';
|
||||||
import { assert } from '../util/assert';
|
import { assert } from '../util/assert';
|
||||||
import { shouldBlurAvatar } from '../util/shouldBlurAvatar';
|
import { shouldBlurAvatar } from '../util/shouldBlurAvatar';
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { AvatarColorPicker, PropsType } from './AvatarColorPicker';
|
import type { PropsType } from './AvatarColorPicker';
|
||||||
|
import { AvatarColorPicker } from './AvatarColorPicker';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import { LocalizerType } from '../types/Util';
|
import { AvatarColors } from '../types/Colors';
|
||||||
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { AvatarEditor, PropsType } from './AvatarEditor';
|
import type { PropsType } from './AvatarEditor';
|
||||||
|
import { AvatarEditor } from './AvatarEditor';
|
||||||
import { getDefaultAvatars } from '../types/Avatar';
|
import { getDefaultAvatars } from '../types/Avatar';
|
||||||
import { createAvatarData } from '../util/createAvatarData';
|
import { createAvatarData } from '../util/createAvatarData';
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import {
|
import type {
|
||||||
AvatarDataType,
|
AvatarDataType,
|
||||||
DeleteAvatarFromDiskActionType,
|
DeleteAvatarFromDiskActionType,
|
||||||
ReplaceAvatarActionType,
|
ReplaceAvatarActionType,
|
||||||
|
@ -16,7 +16,7 @@ import { AvatarPreview } from './AvatarPreview';
|
||||||
import { AvatarTextEditor } from './AvatarTextEditor';
|
import { AvatarTextEditor } from './AvatarTextEditor';
|
||||||
import { AvatarUploadButton } from './AvatarUploadButton';
|
import { AvatarUploadButton } from './AvatarUploadButton';
|
||||||
import { BetterAvatar } from './BetterAvatar';
|
import { BetterAvatar } from './BetterAvatar';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
||||||
import { createAvatarData } from '../util/createAvatarData';
|
import { createAvatarData } from '../util/createAvatarData';
|
||||||
import { isSameAvatarData } from '../util/isSameAvatarData';
|
import { isSameAvatarData } from '../util/isSameAvatarData';
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { AvatarIconEditor, PropsType } from './AvatarIconEditor';
|
import type { PropsType } from './AvatarIconEditor';
|
||||||
|
import { AvatarIconEditor } from './AvatarIconEditor';
|
||||||
import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar';
|
import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { createAvatarData } from '../util/createAvatarData';
|
import { createAvatarData } from '../util/createAvatarData';
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { AvatarColorPicker } from './AvatarColorPicker';
|
import { AvatarColorPicker } from './AvatarColorPicker';
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import { AvatarDataType } from '../types/Avatar';
|
import type { AvatarDataType } from '../types/Avatar';
|
||||||
import { AvatarModalButtons } from './AvatarModalButtons';
|
import { AvatarModalButtons } from './AvatarModalButtons';
|
||||||
import { AvatarPreview } from './AvatarPreview';
|
import { AvatarPreview } from './AvatarPreview';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { select } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { AvatarLightbox, PropsType } from './AvatarLightbox';
|
import type { PropsType } from './AvatarLightbox';
|
||||||
|
import { AvatarLightbox } from './AvatarLightbox';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import { AvatarPreview } from './AvatarPreview';
|
import { AvatarPreview } from './AvatarPreview';
|
||||||
import { Lightbox } from './Lightbox';
|
import { Lightbox } from './Lightbox';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
avatarColor?: AvatarColorType;
|
avatarColor?: AvatarColorType;
|
||||||
|
|
|
@ -7,7 +7,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { AvatarModalButtons, PropsType } from './AvatarModalButtons';
|
import type { PropsType } from './AvatarModalButtons';
|
||||||
|
import { AvatarModalButtons } from './AvatarModalButtons';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -5,7 +5,7 @@ import React, { useState } from 'react';
|
||||||
|
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from './Button';
|
||||||
import { ConfirmDiscardDialog } from './ConfirmDiscardDialog';
|
import { ConfirmDiscardDialog } from './ConfirmDiscardDialog';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -7,8 +7,10 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { boolean, select, text } from '@storybook/addon-knobs';
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import { AvatarPopup, Props } from './AvatarPopup';
|
import type { Props } from './AvatarPopup';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import { AvatarPopup } from './AvatarPopup';
|
||||||
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Avatar, Props as AvatarProps } from './Avatar';
|
import type { Props as AvatarProps } from './Avatar';
|
||||||
|
import { Avatar } from './Avatar';
|
||||||
import { useRestoreFocus } from '../hooks/useRestoreFocus';
|
import { useRestoreFocus } from '../hooks/useRestoreFocus';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
readonly i18n: LocalizerType;
|
readonly i18n: LocalizerType;
|
||||||
|
|
|
@ -7,7 +7,8 @@ import { chunk } from 'lodash';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
|
|
||||||
import { AvatarPreview, PropsType } from './AvatarPreview';
|
import type { PropsType } from './AvatarPreview';
|
||||||
|
import { AvatarPreview } from './AvatarPreview';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { CSSProperties, useEffect, useRef, useState } from 'react';
|
import type { CSSProperties } from 'react';
|
||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
|
|
||||||
import * as log from '../logging/log';
|
import * as log from '../logging/log';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { getInitials } from '../util/getInitials';
|
import { getInitials } from '../util/getInitials';
|
||||||
import { imagePathToBytes } from '../util/imagePathToBytes';
|
import { imagePathToBytes } from '../util/imagePathToBytes';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { AvatarTextEditor, PropsType } from './AvatarTextEditor';
|
import type { PropsType } from './AvatarTextEditor';
|
||||||
|
import { AvatarTextEditor } from './AvatarTextEditor';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import type { ChangeEvent, ClipboardEvent } from 'react';
|
||||||
import React, {
|
import React, {
|
||||||
ChangeEvent,
|
|
||||||
ClipboardEvent,
|
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
|
@ -15,10 +14,10 @@ import { noop } from 'lodash';
|
||||||
import * as grapheme from '../util/grapheme';
|
import * as grapheme from '../util/grapheme';
|
||||||
import { AvatarColorPicker } from './AvatarColorPicker';
|
import { AvatarColorPicker } from './AvatarColorPicker';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { AvatarDataType } from '../types/Avatar';
|
import type { AvatarDataType } from '../types/Avatar';
|
||||||
import { AvatarModalButtons } from './AvatarModalButtons';
|
import { AvatarModalButtons } from './AvatarModalButtons';
|
||||||
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
||||||
import { createAvatarData } from '../util/createAvatarData';
|
import { createAvatarData } from '../util/createAvatarData';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { AvatarUploadButton, PropsType } from './AvatarUploadButton';
|
import type { PropsType } from './AvatarUploadButton';
|
||||||
|
import { AvatarUploadButton } from './AvatarUploadButton';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { ChangeEventHandler, useEffect, useRef, useState } from 'react';
|
import type { ChangeEventHandler } from 'react';
|
||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { processImageFile } from '../util/processImageFile';
|
import { processImageFile } from '../util/processImageFile';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import * as Backbone from 'backbone';
|
import type * as Backbone from 'backbone';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
View: typeof Backbone.View;
|
View: typeof Backbone.View;
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar';
|
import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar';
|
||||||
import { BetterAvatar, PropsType } from './BetterAvatar';
|
import type { PropsType } from './BetterAvatar';
|
||||||
|
import { BetterAvatar } from './BetterAvatar';
|
||||||
import { createAvatarData } from '../util/createAvatarData';
|
import { createAvatarData } from '../util/createAvatarData';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { MouseEvent, useEffect, useState } from 'react';
|
import type { MouseEvent } from 'react';
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
import { AvatarDataType } from '../types/Avatar';
|
import type { AvatarDataType } from '../types/Avatar';
|
||||||
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
import { avatarDataToBytes } from '../util/avatarDataToBytes';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { BetterAvatarBubble, PropsType } from './BetterAvatarBubble';
|
import type { PropsType } from './BetterAvatarBubble';
|
||||||
|
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
|
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
||||||
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
import type { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
||||||
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { assert } from '../util/assert';
|
import { assert } from '../util/assert';
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
avatarPath?: string;
|
avatarPath?: string;
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { boolean, select, text } from '@storybook/addon-knobs';
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import { CallManager, PropsType } from './CallManager';
|
import type { PropsType } from './CallManager';
|
||||||
|
import { CallManager } from './CallManager';
|
||||||
import {
|
import {
|
||||||
CallEndedReason,
|
CallEndedReason,
|
||||||
CallMode,
|
CallMode,
|
||||||
|
@ -14,12 +15,13 @@ import {
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
GroupCallJoinState,
|
GroupCallJoinState,
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
import { ConversationTypeType } from '../state/ducks/conversations';
|
import type { ConversationTypeType } from '../state/ducks/conversations';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
|
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
|
import type { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -11,22 +11,22 @@ import { CallingParticipantsList } from './CallingParticipantsList';
|
||||||
import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal';
|
import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal';
|
||||||
import { CallingPip } from './CallingPip';
|
import { CallingPip } from './CallingPip';
|
||||||
import { IncomingCallBar } from './IncomingCallBar';
|
import { IncomingCallBar } from './IncomingCallBar';
|
||||||
import {
|
import type { SafetyNumberProps } from './SafetyNumberChangeDialog';
|
||||||
SafetyNumberChangeDialog,
|
import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog';
|
||||||
SafetyNumberProps,
|
import type {
|
||||||
} from './SafetyNumberChangeDialog';
|
|
||||||
import {
|
|
||||||
ActiveCallType,
|
ActiveCallType,
|
||||||
|
GroupCallVideoRequest,
|
||||||
|
PresentedSource,
|
||||||
|
} from '../types/Calling';
|
||||||
|
import {
|
||||||
CallEndedReason,
|
CallEndedReason,
|
||||||
CallMode,
|
CallMode,
|
||||||
CallState,
|
CallState,
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
GroupCallJoinState,
|
GroupCallJoinState,
|
||||||
GroupCallVideoRequest,
|
|
||||||
PresentedSource,
|
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import {
|
import type {
|
||||||
AcceptCallType,
|
AcceptCallType,
|
||||||
CancelCallType,
|
CancelCallType,
|
||||||
DeclineCallType,
|
DeclineCallType,
|
||||||
|
@ -39,7 +39,7 @@ import {
|
||||||
SetRendererCanvasType,
|
SetRendererCanvasType,
|
||||||
StartCallType,
|
StartCallType,
|
||||||
} from '../state/ducks/calling';
|
} from '../state/ducks/calling';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
|
|
||||||
const GROUP_CALL_RING_DURATION = 60 * 1000;
|
const GROUP_CALL_RING_DURATION = 60 * 1000;
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { useRef, useEffect } from 'react';
|
import React, { useRef, useEffect } from 'react';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { Avatar } from './Avatar';
|
import { Avatar } from './Avatar';
|
||||||
import { Intl } from './Intl';
|
import { Intl } from './Intl';
|
||||||
import { ContactName } from './conversation/ContactName';
|
import { ContactName } from './conversation/ContactName';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
conversation: Pick<
|
conversation: Pick<
|
||||||
|
|
|
@ -8,16 +8,17 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { boolean, select, number } from '@storybook/addon-knobs';
|
import { boolean, select, number } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
|
import type { GroupCallRemoteParticipantType } from '../types/Calling';
|
||||||
import {
|
import {
|
||||||
CallMode,
|
CallMode,
|
||||||
CallState,
|
CallState,
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
GroupCallJoinState,
|
GroupCallJoinState,
|
||||||
GroupCallRemoteParticipantType,
|
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { CallScreen, PropsType } from './CallScreen';
|
import type { PropsType } from './CallScreen';
|
||||||
|
import { CallScreen } from './CallScreen';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
// Copyright 2020-2021 Signal Messenger, LLC
|
// Copyright 2020-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, {
|
import type { ReactNode } from 'react';
|
||||||
ReactNode,
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||||
useState,
|
|
||||||
useRef,
|
|
||||||
useEffect,
|
|
||||||
useCallback,
|
|
||||||
} from 'react';
|
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { VideoFrameSource } from 'ringrtc';
|
import type { VideoFrameSource } from 'ringrtc';
|
||||||
import {
|
import type {
|
||||||
HangUpType,
|
HangUpType,
|
||||||
SetLocalAudioType,
|
SetLocalAudioType,
|
||||||
SetLocalPreviewType,
|
SetLocalPreviewType,
|
||||||
|
@ -23,21 +18,24 @@ import { CallingHeader } from './CallingHeader';
|
||||||
import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo';
|
import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo';
|
||||||
import { CallingButton, CallingButtonType } from './CallingButton';
|
import { CallingButton, CallingButtonType } from './CallingButton';
|
||||||
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
||||||
import {
|
import type {
|
||||||
ActiveCallType,
|
ActiveCallType,
|
||||||
|
GroupCallVideoRequest,
|
||||||
|
PresentedSource,
|
||||||
|
} from '../types/Calling';
|
||||||
|
import {
|
||||||
CallMode,
|
CallMode,
|
||||||
CallState,
|
CallState,
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
GroupCallJoinState,
|
GroupCallJoinState,
|
||||||
GroupCallVideoRequest,
|
|
||||||
PresentedSource,
|
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
|
import { AvatarColors } from '../types/Colors';
|
||||||
import type { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { CallingToastManager } from './CallingToastManager';
|
import { CallingToastManager } from './CallingToastManager';
|
||||||
import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
||||||
import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants';
|
import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal';
|
import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import * as KeyboardLayout from '../services/keyboardLayout';
|
import * as KeyboardLayout from '../services/keyboardLayout';
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { select } from '@storybook/addon-knobs';
|
import { select } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { CallingButton, CallingButtonType, PropsType } from './CallingButton';
|
import type { PropsType } from './CallingButton';
|
||||||
|
import { CallingButton, CallingButtonType } from './CallingButton';
|
||||||
import { TooltipPlacement } from './Tooltip';
|
import { TooltipPlacement } from './Tooltip';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Tooltip, TooltipPlacement } from './Tooltip';
|
import type { TooltipPlacement } from './Tooltip';
|
||||||
|
import { Tooltip } from './Tooltip';
|
||||||
import { Theme } from '../util/theme';
|
import { Theme } from '../util/theme';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export enum CallingButtonType {
|
export enum CallingButtonType {
|
||||||
AUDIO_DISABLED = 'AUDIO_DISABLED',
|
AUDIO_DISABLED = 'AUDIO_DISABLED',
|
||||||
|
|
|
@ -5,7 +5,8 @@ import * as React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
|
|
||||||
import { CallingDeviceSelection, Props } from './CallingDeviceSelection';
|
import type { Props } from './CallingDeviceSelection';
|
||||||
|
import { CallingDeviceSelection } from './CallingDeviceSelection';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ import * as React from 'react';
|
||||||
import type { AudioDevice } from 'ringrtc';
|
import type { AudioDevice } from 'ringrtc';
|
||||||
|
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import {
|
import type {
|
||||||
CallingDeviceType,
|
|
||||||
ChangeIODevicePayloadType,
|
ChangeIODevicePayloadType,
|
||||||
MediaDeviceSettings,
|
MediaDeviceSettings,
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
|
import { CallingDeviceType } from '../types/Calling';
|
||||||
import { Theme } from '../util/theme';
|
import { Theme } from '../util/theme';
|
||||||
|
|
||||||
export type Props = MediaDeviceSettings & {
|
export type Props = MediaDeviceSettings & {
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { boolean, number } from '@storybook/addon-knobs';
|
import { boolean, number } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { CallingHeader, PropsType } from './CallingHeader';
|
import type { PropsType } from './CallingHeader';
|
||||||
|
import { CallingHeader } from './CallingHeader';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// Copyright 2020-2021 Signal Messenger, LLC
|
// Copyright 2020-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Tooltip } from './Tooltip';
|
import { Tooltip } from './Tooltip';
|
||||||
import { Theme } from '../util/theme';
|
import { Theme } from '../util/theme';
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,9 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { v4 as generateUuid } from 'uuid';
|
import { v4 as generateUuid } from 'uuid';
|
||||||
|
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { CallingLobby, PropsType } from './CallingLobby';
|
import type { PropsType } from './CallingLobby';
|
||||||
|
import { CallingLobby } from './CallingLobby';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {
|
import type {
|
||||||
SetLocalAudioType,
|
SetLocalAudioType,
|
||||||
SetLocalPreviewType,
|
SetLocalPreviewType,
|
||||||
SetLocalVideoType,
|
SetLocalVideoType,
|
||||||
|
@ -17,11 +17,11 @@ import {
|
||||||
CallingLobbyJoinButton,
|
CallingLobbyJoinButton,
|
||||||
CallingLobbyJoinButtonVariant,
|
CallingLobbyJoinButtonVariant,
|
||||||
} from './CallingLobbyJoinButton';
|
} from './CallingLobbyJoinButton';
|
||||||
import { AvatarColorType } from '../types/Colors';
|
import type { AvatarColorType } from '../types/Colors';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { useIsOnline } from '../hooks/useIsOnline';
|
import { useIsOnline } from '../hooks/useIsOnline';
|
||||||
import * as KeyboardLayout from '../services/keyboardLayout';
|
import * as KeyboardLayout from '../services/keyboardLayout';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { isConversationTooBigToRing } from '../conversations/isConversationTooBigToRing';
|
import { isConversationTooBigToRing } from '../conversations/isConversationTooBigToRing';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { FunctionComponent, ReactChild, useState } from 'react';
|
import type { FunctionComponent, ReactChild } from 'react';
|
||||||
|
import React, { useState } from 'react';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
|
|
||||||
import type { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
|
@ -7,9 +7,10 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { v4 as generateUuid } from 'uuid';
|
import { v4 as generateUuid } from 'uuid';
|
||||||
|
|
||||||
import { CallingParticipantsList, PropsType } from './CallingParticipantsList';
|
import type { PropsType } from './CallingParticipantsList';
|
||||||
|
import { CallingParticipantsList } from './CallingParticipantsList';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { GroupCallRemoteParticipantType } from '../types/Calling';
|
import type { GroupCallRemoteParticipantType } from '../types/Calling';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { createPortal } from 'react-dom';
|
||||||
import { Avatar } from './Avatar';
|
import { Avatar } from './Avatar';
|
||||||
import { ContactName } from './conversation/ContactName';
|
import { ContactName } from './conversation/ContactName';
|
||||||
import { InContactsIcon } from './InContactsIcon';
|
import { InContactsIcon } from './InContactsIcon';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { sortByTitle } from '../util/sortByTitle';
|
import { sortByTitle } from '../util/sortByTitle';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { isInSystemContacts } from '../util/isInSystemContacts';
|
import { isInSystemContacts } from '../util/isInSystemContacts';
|
||||||
|
|
||||||
type ParticipantType = ConversationType & {
|
type ParticipantType = ConversationType & {
|
||||||
|
|
|
@ -8,10 +8,11 @@ import { boolean } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { CallingPip, PropsType } from './CallingPip';
|
import type { PropsType } from './CallingPip';
|
||||||
|
import { CallingPip } from './CallingPip';
|
||||||
|
import type { ActiveCallType } from '../types/Calling';
|
||||||
import {
|
import {
|
||||||
ActiveCallType,
|
|
||||||
CallMode,
|
CallMode,
|
||||||
CallState,
|
CallState,
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
|
|
|
@ -5,9 +5,9 @@ import React from 'react';
|
||||||
import { minBy, debounce, noop } from 'lodash';
|
import { minBy, debounce, noop } from 'lodash';
|
||||||
import type { VideoFrameSource } from 'ringrtc';
|
import type { VideoFrameSource } from 'ringrtc';
|
||||||
import { CallingPipRemoteVideo } from './CallingPipRemoteVideo';
|
import { CallingPipRemoteVideo } from './CallingPipRemoteVideo';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import type { ActiveCallType, GroupCallVideoRequest } from '../types/Calling';
|
import type { ActiveCallType, GroupCallVideoRequest } from '../types/Calling';
|
||||||
import {
|
import type {
|
||||||
HangUpType,
|
HangUpType,
|
||||||
SetLocalPreviewType,
|
SetLocalPreviewType,
|
||||||
SetRendererCanvasType,
|
SetRendererCanvasType,
|
||||||
|
|
|
@ -8,15 +8,15 @@ import { Avatar } from './Avatar';
|
||||||
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
||||||
import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
||||||
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant';
|
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import {
|
import type {
|
||||||
ActiveCallType,
|
ActiveCallType,
|
||||||
CallMode,
|
|
||||||
GroupCallRemoteParticipantType,
|
GroupCallRemoteParticipantType,
|
||||||
GroupCallVideoRequest,
|
GroupCallVideoRequest,
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
|
import { CallMode } from '../types/Calling';
|
||||||
import { AvatarColors } from '../types/Colors';
|
import { AvatarColors } from '../types/Colors';
|
||||||
import { SetRendererCanvasType } from '../state/ducks/calling';
|
import type { SetRendererCanvasType } from '../state/ducks/calling';
|
||||||
import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer';
|
import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer';
|
||||||
import { usePageVisibility } from '../hooks/usePageVisibility';
|
import { usePageVisibility } from '../hooks/usePageVisibility';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { FunctionComponent } from 'react';
|
import type { FunctionComponent } from 'react';
|
||||||
|
import React from 'react';
|
||||||
import type { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import type { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Avatar, AvatarSize } from './Avatar';
|
import { Avatar, AvatarSize } from './Avatar';
|
||||||
|
|
|
@ -5,10 +5,8 @@ import React from 'react';
|
||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import {
|
import type { PropsType } from './CallingScreenSharingController';
|
||||||
CallingScreenSharingController,
|
import { CallingScreenSharingController } from './CallingScreenSharingController';
|
||||||
PropsType,
|
|
||||||
} from './CallingScreenSharingController';
|
|
||||||
|
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from './Button';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
|
|
@ -5,10 +5,8 @@ import React from 'react';
|
||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import {
|
import type { PropsType } from './CallingSelectPresentingSourcesModal';
|
||||||
CallingSelectPresentingSourcesModal,
|
import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal';
|
||||||
PropsType,
|
|
||||||
} from './CallingSelectPresentingSourcesModal';
|
|
||||||
|
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -5,9 +5,9 @@ import React, { useState } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { groupBy } from 'lodash';
|
import { groupBy } from 'lodash';
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from './Button';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
import { PresentedSource, PresentableSource } from '../types/Calling';
|
import type { PresentedSource, PresentableSource } from '../types/Calling';
|
||||||
import { Theme } from '../util/theme';
|
import { Theme } from '../util/theme';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
|
|
|
@ -3,13 +3,10 @@
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {
|
import type { ActiveCallType } from '../types/Calling';
|
||||||
ActiveCallType,
|
import { CallMode, GroupCallConnectionState } from '../types/Calling';
|
||||||
CallMode,
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
GroupCallConnectionState,
|
import type { LocalizerType } from '../types/Util';
|
||||||
} from '../types/Calling';
|
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
|
||||||
import { LocalizerType } from '../types/Util';
|
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
activeCall: ActiveCallType;
|
activeCall: ActiveCallType;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from './Button';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
|
|
|
@ -7,7 +7,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { text } from '@storybook/addon-knobs';
|
import { text } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { CaptionEditor, Props } from './CaptionEditor';
|
import type { Props } from './CaptionEditor';
|
||||||
|
import { CaptionEditor } from './CaptionEditor';
|
||||||
import { AUDIO_MP3, IMAGE_JPEG, VIDEO_MP4 } from '../types/MIME';
|
import { AUDIO_MP3, IMAGE_JPEG, VIDEO_MP4 } from '../types/MIME';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import * as GoogleChrome from '../util/GoogleChrome';
|
import * as GoogleChrome from '../util/GoogleChrome';
|
||||||
|
|
||||||
import { AttachmentType } from '../types/Attachment';
|
import type { AttachmentType } from '../types/Attachment';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
attachment: AttachmentType;
|
attachment: AttachmentType;
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { select } from '@storybook/addon-knobs';
|
import { select } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { ChatColorPicker, PropsType } from './ChatColorPicker';
|
import type { PropsType } from './ChatColorPicker';
|
||||||
|
import { ChatColorPicker } from './ChatColorPicker';
|
||||||
import { ConversationColors } from '../types/Colors';
|
import { ConversationColors } from '../types/Colors';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { KeyboardEvent, MouseEvent, useRef, useState } from 'react';
|
import type { KeyboardEvent, MouseEvent } from 'react';
|
||||||
|
import React, { useRef, useState } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu';
|
import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu';
|
||||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
import { ConfirmationDialog } from './ConfirmationDialog';
|
||||||
import { CustomColorEditor } from './CustomColorEditor';
|
import { CustomColorEditor } from './CustomColorEditor';
|
||||||
import { Modal } from './Modal';
|
import { Modal } from './Modal';
|
||||||
import {
|
import type { ConversationColorType, CustomColorType } from '../types/Colors';
|
||||||
ConversationColors,
|
import { ConversationColors } from '../types/Colors';
|
||||||
ConversationColorType,
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
CustomColorType,
|
import type { LocalizerType } from '../types/Util';
|
||||||
} from '../types/Colors';
|
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
|
||||||
import { LocalizerType } from '../types/Util';
|
|
||||||
import { SampleMessageBubbles } from './SampleMessageBubbles';
|
import { SampleMessageBubbles } from './SampleMessageBubbles';
|
||||||
import { PanelRow } from './conversation/conversation-details/PanelRow';
|
import { PanelRow } from './conversation/conversation-details/PanelRow';
|
||||||
import { getCustomColorStyle } from '../util/getCustomColorStyle';
|
import { getCustomColorStyle } from '../util/getCustomColorStyle';
|
||||||
|
|
|
@ -5,7 +5,8 @@ import React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
|
|
||||||
import { Checkbox, PropsType } from './Checkbox';
|
import type { PropsType } from './Checkbox';
|
||||||
|
import { Checkbox } from './Checkbox';
|
||||||
|
|
||||||
const createProps = (): PropsType => ({
|
const createProps = (): PropsType => ({
|
||||||
checked: false,
|
checked: false,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
deleteAllData: () => void;
|
deleteAllData: () => void;
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { boolean } from '@storybook/addon-knobs';
|
import { boolean } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import { IMAGE_JPEG } from '../types/MIME';
|
import { IMAGE_JPEG } from '../types/MIME';
|
||||||
import { CompositionArea, Props } from './CompositionArea';
|
import type { Props } from './CompositionArea';
|
||||||
|
import { CompositionArea } from './CompositionArea';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -1,53 +1,47 @@
|
||||||
// Copyright 2019-2021 Signal Messenger, LLC
|
// Copyright 2019-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, {
|
import type { MutableRefObject } from 'react';
|
||||||
MutableRefObject,
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useRef,
|
|
||||||
useState,
|
|
||||||
} from 'react';
|
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { BodyRangeType, BodyRangesType } from '../types/Util';
|
import type {
|
||||||
|
BodyRangeType,
|
||||||
|
BodyRangesType,
|
||||||
|
LocalizerType,
|
||||||
|
} from '../types/Util';
|
||||||
import type { ErrorDialogAudioRecorderType } from '../state/ducks/audioRecorder';
|
import type { ErrorDialogAudioRecorderType } from '../state/ducks/audioRecorder';
|
||||||
import type { HandleAttachmentsProcessingArgsType } from '../util/handleAttachmentsProcessing';
|
import type { HandleAttachmentsProcessingArgsType } from '../util/handleAttachmentsProcessing';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
import { EmojiButton, Props as EmojiButtonProps } from './emoji/EmojiButton';
|
import type { Props as EmojiButtonProps } from './emoji/EmojiButton';
|
||||||
import {
|
import { EmojiButton } from './emoji/EmojiButton';
|
||||||
Props as StickerButtonProps,
|
import type { Props as StickerButtonProps } from './stickers/StickerButton';
|
||||||
StickerButton,
|
import { StickerButton } from './stickers/StickerButton';
|
||||||
} from './stickers/StickerButton';
|
import type {
|
||||||
import {
|
|
||||||
CompositionInput,
|
|
||||||
InputApi,
|
InputApi,
|
||||||
Props as CompositionInputProps,
|
Props as CompositionInputProps,
|
||||||
} from './CompositionInput';
|
} from './CompositionInput';
|
||||||
import {
|
import { CompositionInput } from './CompositionInput';
|
||||||
MessageRequestActions,
|
import type { Props as MessageRequestActionsProps } from './conversation/MessageRequestActions';
|
||||||
Props as MessageRequestActionsProps,
|
import { MessageRequestActions } from './conversation/MessageRequestActions';
|
||||||
} from './conversation/MessageRequestActions';
|
import type { PropsType as GroupV1DisabledActionsPropsType } from './conversation/GroupV1DisabledActions';
|
||||||
import {
|
import { GroupV1DisabledActions } from './conversation/GroupV1DisabledActions';
|
||||||
GroupV1DisabledActions,
|
import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './conversation/GroupV2PendingApprovalActions';
|
||||||
PropsType as GroupV1DisabledActionsPropsType,
|
import { GroupV2PendingApprovalActions } from './conversation/GroupV2PendingApprovalActions';
|
||||||
} from './conversation/GroupV1DisabledActions';
|
|
||||||
import {
|
|
||||||
GroupV2PendingApprovalActions,
|
|
||||||
PropsType as GroupV2PendingApprovalActionsPropsType,
|
|
||||||
} from './conversation/GroupV2PendingApprovalActions';
|
|
||||||
import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner';
|
import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner';
|
||||||
import { AttachmentList } from './conversation/AttachmentList';
|
import { AttachmentList } from './conversation/AttachmentList';
|
||||||
import { AttachmentType, isImageAttachment } from '../types/Attachment';
|
import type { AttachmentType } from '../types/Attachment';
|
||||||
|
import { isImageAttachment } from '../types/Attachment';
|
||||||
import { AudioCapture } from './conversation/AudioCapture';
|
import { AudioCapture } from './conversation/AudioCapture';
|
||||||
import { CompositionUpload } from './CompositionUpload';
|
import { CompositionUpload } from './CompositionUpload';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { EmojiPickDataType } from './emoji/EmojiPicker';
|
import type { EmojiPickDataType } from './emoji/EmojiPicker';
|
||||||
import { LinkPreviewWithDomain } from '../types/LinkPreview';
|
import type { LinkPreviewWithDomain } from '../types/LinkPreview';
|
||||||
import { LocalizerType } from '../types/Util';
|
|
||||||
import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions';
|
import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions';
|
||||||
import { MediaQualitySelector } from './MediaQualitySelector';
|
import { MediaQualitySelector } from './MediaQualitySelector';
|
||||||
import { Quote, Props as QuoteProps } from './conversation/Quote';
|
import type { Props as QuoteProps } from './conversation/Quote';
|
||||||
|
import { Quote } from './conversation/Quote';
|
||||||
import { StagedLinkPreview } from './conversation/StagedLinkPreview';
|
import { StagedLinkPreview } from './conversation/StagedLinkPreview';
|
||||||
import { countStickers } from './stickers/lib';
|
import { countStickers } from './stickers/lib';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import { CompositionInput, Props } from './CompositionInput';
|
import type { Props } from './CompositionInput';
|
||||||
|
import { CompositionInput } from './CompositionInput';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,15 @@ import Delta from 'quill-delta';
|
||||||
import ReactQuill from 'react-quill';
|
import ReactQuill from 'react-quill';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Manager, Reference } from 'react-popper';
|
import { Manager, Reference } from 'react-popper';
|
||||||
import Quill, { KeyboardStatic, RangeStatic } from 'quill';
|
import type { KeyboardStatic, RangeStatic } from 'quill';
|
||||||
|
import Quill from 'quill';
|
||||||
|
|
||||||
import { MentionCompletion } from '../quill/mentions/completion';
|
import { MentionCompletion } from '../quill/mentions/completion';
|
||||||
import { EmojiBlot, EmojiCompletion } from '../quill/emoji';
|
import { EmojiBlot, EmojiCompletion } from '../quill/emoji';
|
||||||
import { EmojiPickDataType } from './emoji/EmojiPicker';
|
import type { EmojiPickDataType } from './emoji/EmojiPicker';
|
||||||
import { convertShortName } from './emoji/lib';
|
import { convertShortName } from './emoji/lib';
|
||||||
import { LocalizerType, BodyRangeType } from '../types/Util';
|
import type { LocalizerType, BodyRangeType } from '../types/Util';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { MentionBlot } from '../quill/mentions/blot';
|
import { MentionBlot } from '../quill/mentions/blot';
|
||||||
import {
|
import {
|
||||||
matchEmojiImage,
|
matchEmojiImage,
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { ChangeEventHandler, forwardRef, useState } from 'react';
|
import type { ChangeEventHandler } from 'react';
|
||||||
|
import React, { forwardRef, useState } from 'react';
|
||||||
|
|
||||||
import { AttachmentType } from '../types/Attachment';
|
import type { AttachmentType } from '../types/Attachment';
|
||||||
import { AttachmentToastType } from '../types/AttachmentToastType';
|
import { AttachmentToastType } from '../types/AttachmentToastType';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
import { ToastCannotMixImageAndNonImageAttachments } from './ToastCannotMixImageAndNonImageAttachments';
|
import { ToastCannotMixImageAndNonImageAttachments } from './ToastCannotMixImageAndNonImageAttachments';
|
||||||
import { ToastDangerousFileType } from './ToastDangerousFileType';
|
import { ToastDangerousFileType } from './ToastDangerousFileType';
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { setupI18n } from '../util/setupI18n';
|
import { setupI18n } from '../util/setupI18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
import { ConfirmDiscardDialog, PropsType } from './ConfirmDiscardDialog';
|
import type { PropsType } from './ConfirmDiscardDialog';
|
||||||
|
import { ConfirmDiscardDialog } from './ConfirmDiscardDialog';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
import { ConfirmationDialog } from './ConfirmationDialog';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// Copyright 2019-2021 Signal Messenger, LLC
|
// Copyright 2019-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import React, { MouseEvent, useCallback } from 'react';
|
import type { MouseEvent } from 'react';
|
||||||
|
import React, { useCallback } from 'react';
|
||||||
import { animated } from '@react-spring/web';
|
import { animated } from '@react-spring/web';
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from './Button';
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { ModalHost } from './ModalHost';
|
import { ModalHost } from './ModalHost';
|
||||||
import { Modal, ModalWindow } from './Modal';
|
import { Modal, ModalWindow } from './Modal';
|
||||||
import { Theme } from '../util/theme';
|
import type { Theme } from '../util/theme';
|
||||||
import { useAnimated } from '../hooks/useAnimated';
|
import { useAnimated } from '../hooks/useAnimated';
|
||||||
|
|
||||||
export type ActionSpec = {
|
export type ActionSpec = {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import { Avatar } from './Avatar';
|
||||||
import { Emojify } from './conversation/Emojify';
|
import { Emojify } from './conversation/Emojify';
|
||||||
import { InContactsIcon } from './InContactsIcon';
|
import { InContactsIcon } from './InContactsIcon';
|
||||||
|
|
||||||
import { LocalizerType } from '../types/Util';
|
import type { LocalizerType } from '../types/Util';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { isInSystemContacts } from '../util/isInSystemContacts';
|
import { isInSystemContacts } from '../util/isInSystemContacts';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue