Qualify CJS-only module imports
This commit is contained in:
parent
140241b83f
commit
40eaf078cc
401 changed files with 1278 additions and 593 deletions
|
@ -6,7 +6,7 @@ import {
|
|||
DigestingPassThrough,
|
||||
ValidatingPassThrough,
|
||||
inferChunkSize,
|
||||
} from '@signalapp/libsignal-client/dist/incremental_mac';
|
||||
} from '@signalapp/libsignal-client/dist/incremental_mac.js';
|
||||
import { ipcMain, protocol } from 'electron';
|
||||
import { LRUCache } from 'lru-cache';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
|
@ -17,7 +17,7 @@ import { PassThrough, type Writable } from 'node:stream';
|
|||
import { pipeline } from 'node:stream/promises';
|
||||
import z from 'zod';
|
||||
import GrowingFile from 'growing-file';
|
||||
import { isNumber } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import {
|
||||
type DecryptAttachmentToSinkOptionsType,
|
||||
|
@ -65,6 +65,8 @@ import {
|
|||
getTempPath,
|
||||
} from './attachments.js';
|
||||
|
||||
const { isNumber } = lodash;
|
||||
|
||||
const log = createLogger('attachment_channel');
|
||||
|
||||
let initialized = false;
|
||||
|
|
|
@ -7,7 +7,7 @@ import { join, relative, normalize } from 'node:path';
|
|||
import pMap from 'p-map';
|
||||
import fastGlob from 'fast-glob';
|
||||
import fse from 'fs-extra';
|
||||
import { map, isString } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import normalizePath from 'normalize-path';
|
||||
import { isPathInside } from '../ts/util/isPathInside.js';
|
||||
import { DAY } from '../ts/util/durations/index.js';
|
||||
|
@ -22,6 +22,8 @@ import type { LocalAttachmentV2Type } from '../ts/types/Attachment.js';
|
|||
import * as Errors from '../ts/types/errors.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const { map, isString } = lodash;
|
||||
|
||||
const log = createLogger('attachments');
|
||||
|
||||
const PATH = 'attachments.noindex';
|
||||
|
|
|
@ -4,11 +4,15 @@
|
|||
import { readFileSync, unlinkSync } from 'node:fs';
|
||||
import { sync as writeFileSync } from 'write-file-atomic';
|
||||
|
||||
import { get } from 'lodash';
|
||||
import { set } from 'lodash/fp';
|
||||
import lodash from 'lodash';
|
||||
import lodashFp from 'lodash/fp.js';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const { set } = lodashFp;
|
||||
|
||||
const { get } = lodash;
|
||||
|
||||
const log = createLogger('base_config');
|
||||
|
||||
const ENCODING = 'utf8';
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { app, crashReporter, ipcMain as ipc } from 'electron';
|
||||
import { realpath, readdir, readFile, unlink, stat } from 'fs-extra';
|
||||
import fsExtra from 'fs-extra';
|
||||
import { basename, join } from 'node:path';
|
||||
import { toJSONString as dumpToJSONString } from '@signalapp/libsignal-client/dist/Minidump';
|
||||
import { toJSONString as dumpToJSONString } from '@signalapp/libsignal-client/dist/Minidump.js';
|
||||
import z from 'zod';
|
||||
|
||||
import type { LoggerType } from '../ts/types/Logging.js';
|
||||
|
@ -14,6 +14,8 @@ import { isNotNil } from '../ts/util/isNotNil.js';
|
|||
import OS from '../ts/util/os/osMain.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
const { realpath, readdir, readFile, unlink, stat } = fsExtra;
|
||||
|
||||
// See https://github.com/rust-minidump/rust-minidump/blob/main/minidump-processor/json-schema.md
|
||||
const dumpString = z.string().or(z.null()).optional();
|
||||
const dumpNumber = z.number().or(z.null()).optional();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import { join } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { app } from 'electron';
|
||||
import { merge } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||
import { z } from 'zod';
|
||||
import { setupI18n } from '../ts/util/setupI18nMain.js';
|
||||
|
@ -19,6 +19,8 @@ import type { LocalizerType } from '../ts/types/Util.js';
|
|||
import * as Errors from '../ts/types/errors.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
const { merge } = lodash;
|
||||
|
||||
type CompactLocaleMessagesType = ReadonlyArray<string | null>;
|
||||
type CompactLocaleKeysType = ReadonlyArray<string>;
|
||||
|
||||
|
|
16
app/main.ts
16
app/main.ts
|
@ -4,13 +4,13 @@
|
|||
import { join, normalize, extname, dirname, basename } from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import * as os from 'node:os';
|
||||
import { chmod, realpath, writeFile } from 'fs-extra';
|
||||
import fsExtra from 'fs-extra';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { createParser } from 'dashdash';
|
||||
|
||||
import fastGlob from 'fast-glob';
|
||||
import PQueue from 'p-queue';
|
||||
import { get, pick, isNumber, isBoolean, some, debounce, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import {
|
||||
app,
|
||||
BrowserWindow,
|
||||
|
@ -32,7 +32,10 @@ import {
|
|||
import type { MenuItemConstructorOptions, Settings } from 'electron';
|
||||
import { z } from 'zod';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import {
|
||||
version as packageVersion,
|
||||
productName,
|
||||
} from '../ts/util/packageJson.js';
|
||||
import * as GlobalErrors from './global_errors.js';
|
||||
import { setup as setupCrashReports } from './crashReports.js';
|
||||
import { setup as setupSpellChecker } from './spell_check.js';
|
||||
|
@ -126,6 +129,9 @@ import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas.js';
|
|||
import { getAppErrorIcon } from '../ts/util/getAppErrorIcon.js';
|
||||
import { promptOSAuth } from '../ts/util/os/promptOSAuthMain.js';
|
||||
|
||||
const { chmod, realpath, writeFile } = fsExtra;
|
||||
const { get, pick, isNumber, isBoolean, some, debounce, noop } = lodash;
|
||||
|
||||
const log = createLogger('app/main');
|
||||
const updaterLog = log.child('updater');
|
||||
|
||||
|
@ -2119,7 +2125,7 @@ app.on('ready', async () => {
|
|||
}
|
||||
|
||||
log.info('app ready');
|
||||
log.info(`starting version ${packageJson.version}`);
|
||||
log.info(`starting version ${packageVersion}`);
|
||||
|
||||
// This logging helps us debug user reports about broken devices.
|
||||
{
|
||||
|
@ -2695,7 +2701,7 @@ ipc.on('get-config', async event => {
|
|||
}
|
||||
|
||||
const parsed = safeParseLoose(rendererConfigSchema, {
|
||||
name: packageJson.productName,
|
||||
name: productName,
|
||||
availableLocales: getResolvedMessagesLocale().availableLocales,
|
||||
resolvedTranslationsLocale: getResolvedMessagesLocale().name,
|
||||
resolvedTranslationsLocaleDirection: getResolvedMessagesLocale().direction,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isString } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../ts/types/I18N.js';
|
||||
import type {
|
||||
|
@ -10,6 +10,8 @@ import type {
|
|||
MenuActionsType,
|
||||
} from '../ts/types/menu.js';
|
||||
|
||||
const { isString } = lodash;
|
||||
|
||||
export type CreateTemplateOptionsType = MenuOptionsType & MenuActionsType;
|
||||
|
||||
export const createTemplate = (
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import { app } from 'electron';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import { name } from '../ts/util/packageJson.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import * as GlobalErrors from './global_errors.js';
|
||||
|
||||
|
@ -15,7 +15,7 @@ GlobalErrors.addHandler();
|
|||
// set such that only we have read access to our files
|
||||
process.umask(0o077);
|
||||
|
||||
export const AUMID = `org.whispersystems.${packageJson.name}`;
|
||||
export const AUMID = `org.whispersystems.${name}`;
|
||||
log.info('Set Windows Application User Model ID (AUMID)', {
|
||||
AUMID,
|
||||
});
|
||||
|
|
|
@ -7,15 +7,14 @@ const { join } = require('node:path');
|
|||
const pMap = require('p-map');
|
||||
const prettier = require('prettier');
|
||||
|
||||
const { default: packageJson } = require('./packageJson.js');
|
||||
|
||||
// During development, you might use local versions of dependencies which are missing
|
||||
// acknowledgment files. In this case we'll skip rebuilding the acknowledgment files.
|
||||
// Enable this flag to throw an error.
|
||||
const REQUIRE_SIGNAL_LIB_FILES = Boolean(process.env.REQUIRE_SIGNAL_LIB_FILES);
|
||||
|
||||
const {
|
||||
dependencies = {},
|
||||
optionalDependencies = {},
|
||||
} = require('../package.json');
|
||||
const { dependencies = {}, optionalDependencies = {} } = packageJson;
|
||||
|
||||
const SIGNAL_LIBS = ['@signalapp/libsignal-client', '@signalapp/ringrtc'];
|
||||
|
||||
|
|
15
scripts/packageJson.js
Normal file
15
scripts/packageJson.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const { readFileSync } = require('node:fs');
|
||||
const { join } = require('node:path');
|
||||
|
||||
const PACKAGE_JSON_PATH = join(__dirname, '..', 'package.json');
|
||||
|
||||
const json = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8'));
|
||||
|
||||
exports.default = json;
|
||||
exports.name = json.name;
|
||||
exports.version = json.version;
|
||||
exports.productName = json.productName;
|
||||
exports.build = json.build;
|
|
@ -4,11 +4,8 @@
|
|||
const fs = require('node:fs');
|
||||
const _ = require('lodash');
|
||||
const { execSync } = require('node:child_process');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
const { isAdhoc } = require('../ts/util/version.js');
|
||||
|
||||
const { version } = packageJson;
|
||||
const { default: packageJson, version } = require('./packageJson.js');
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and adhoc builds. Electron-Builder uses
|
||||
|
|
|
@ -4,10 +4,8 @@
|
|||
const fs = require('node:fs');
|
||||
const _ = require('lodash');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
const { isAlpha } = require('../ts/util/version.js');
|
||||
|
||||
const { version } = packageJson;
|
||||
const { default: packageJson, version } = require('./packageJson.js');
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and alpha builds. Electron-Builder uses
|
||||
|
|
|
@ -4,10 +4,8 @@
|
|||
const fs = require('node:fs');
|
||||
const _ = require('lodash');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
const { isAxolotl } = require('../ts/util/version.js');
|
||||
|
||||
const { version } = packageJson;
|
||||
const { default: packageJson, version } = require('./packageJson.js');
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and alpha builds. Electron-Builder uses
|
||||
|
|
|
@ -4,10 +4,8 @@
|
|||
const fs = require('node:fs');
|
||||
const _ = require('lodash');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
const { isBeta } = require('../ts/util/version.js');
|
||||
|
||||
const { version } = packageJson;
|
||||
const { default: packageJson, version } = require('./packageJson.js');
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and beta builds. Electron-Builder uses
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const fs = require('node:fs');
|
||||
const _ = require('lodash');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
const { isAlpha } = require('../ts/util/version.js');
|
||||
|
||||
const { version } = packageJson;
|
||||
const { default: packageJson, version } = require('./packageJson.js');
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and staging builds. Electron-Builder uses
|
||||
|
|
|
@ -5,6 +5,10 @@ const fs = require('node:fs');
|
|||
const { execSync } = require('node:child_process');
|
||||
|
||||
const _ = require('lodash');
|
||||
const {
|
||||
default: packageJson,
|
||||
version: currentVersion,
|
||||
} = require('./packageJson.js');
|
||||
|
||||
const release = process.argv[2];
|
||||
if (release !== 'alpha' && release !== 'axolotl' && release !== 'adhoc') {
|
||||
|
@ -14,10 +18,6 @@ if (release !== 'alpha' && release !== 'axolotl' && release !== 'adhoc') {
|
|||
|
||||
const { generateTaggedVersion } = require('../ts/util/version.js');
|
||||
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
const { version: currentVersion } = packageJson;
|
||||
|
||||
const shortSha = execSync('git rev-parse --short HEAD')
|
||||
.toString('utf8')
|
||||
.replace(/[\n\r]/g, '');
|
||||
|
|
|
@ -14,16 +14,16 @@ import type { Hash } from 'node:crypto';
|
|||
import { PassThrough, Transform, type Writable, Readable } from 'node:stream';
|
||||
import { pipeline } from 'node:stream/promises';
|
||||
|
||||
import { isNumber } from 'lodash';
|
||||
import { ensureFile } from 'fs-extra';
|
||||
import lodash from 'lodash';
|
||||
import fsExtra from 'fs-extra';
|
||||
import {
|
||||
chunkSizeInBytes,
|
||||
DigestingPassThrough,
|
||||
everyNthByte,
|
||||
inferChunkSize,
|
||||
ValidatingPassThrough,
|
||||
} from '@signalapp/libsignal-client/dist/incremental_mac';
|
||||
import type { ChunkSizeChoice } from '@signalapp/libsignal-client/dist/incremental_mac';
|
||||
} from '@signalapp/libsignal-client/dist/incremental_mac.js';
|
||||
import type { ChunkSizeChoice } from '@signalapp/libsignal-client/dist/incremental_mac.js';
|
||||
import { isAbsolute } from 'node:path';
|
||||
|
||||
import { createLogger } from './logging/log.js';
|
||||
|
@ -53,6 +53,10 @@ import { getEnvironment, Environment } from './environment.js';
|
|||
import { isNotEmpty, toBase64, toHex } from './Bytes.js';
|
||||
import { decipherWithAesKey } from './util/decipherWithAesKey.js';
|
||||
|
||||
const { ensureFile } = fsExtra;
|
||||
|
||||
const { isNumber } = lodash;
|
||||
|
||||
const log = createLogger('AttachmentCrypto');
|
||||
|
||||
// This file was split from ts/Crypto.ts because it pulls things in from node, and
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { debounce, pick, uniq, without } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import PQueue from 'p-queue';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
|
@ -54,6 +54,8 @@ import type {
|
|||
PniString,
|
||||
} from './types/ServiceId.js';
|
||||
|
||||
const { debounce, pick, uniq, without } = lodash;
|
||||
|
||||
const log = createLogger('ConversationController');
|
||||
|
||||
type ConvoMatchType =
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import Long from 'long';
|
||||
import { sample } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Aci, Pni, hkdf } from '@signalapp/libsignal-client';
|
||||
import type { PublicKey, PrivateKey } from '@signalapp/libsignal-client';
|
||||
import { AccountEntropyPool } from '@signalapp/libsignal-client/dist/AccountKeys';
|
||||
import { AccountEntropyPool } from '@signalapp/libsignal-client/dist/AccountKeys.js';
|
||||
|
||||
import * as Bytes from './Bytes.js';
|
||||
import { Crypto } from './context/Crypto.js';
|
||||
|
@ -20,6 +20,8 @@ import { toWebSafeBase64 } from './util/webSafeBase64.js';
|
|||
|
||||
import type { AciString, PniString } from './types/ServiceId.js';
|
||||
|
||||
const { sample } = lodash;
|
||||
|
||||
export { HashType, CipherType };
|
||||
|
||||
const PROFILE_IV_LENGTH = 12; // bytes
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import { isNumber } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type {
|
||||
Direction,
|
||||
|
@ -33,6 +33,8 @@ import { normalizeServiceId } from './types/ServiceId.js';
|
|||
|
||||
import type { Zone } from './util/Zone.js';
|
||||
|
||||
const { isNumber } = lodash;
|
||||
|
||||
function encodeAddress(address: ProtocolAddress): Address {
|
||||
const name = address.name();
|
||||
const deviceId = address.deviceId();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { get, throttle } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { WebAPIType } from './textsecure/WebAPI.js';
|
||||
import { createLogger } from './logging/log.js';
|
||||
|
@ -14,6 +14,8 @@ import { HashType } from './types/Crypto.js';
|
|||
import { getCountryCode } from './types/PhoneNumber.js';
|
||||
import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.js';
|
||||
|
||||
const { get, throttle } = lodash;
|
||||
|
||||
const log = createLogger('RemoteConfig');
|
||||
|
||||
const KnownConfigKeys = [
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import PQueue from 'p-queue';
|
||||
import { omit } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { z } from 'zod';
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
||||
|
@ -69,6 +69,8 @@ import {
|
|||
import { formatGroups, groupWhile } from './util/groupWhile.js';
|
||||
import { parseUnknown } from './util/schemas.js';
|
||||
|
||||
const { omit } = lodash;
|
||||
|
||||
const log = createLogger('SignalProtocolStore');
|
||||
|
||||
const TIMESTAMP_THRESHOLD = 5 * 1000; // 5 seconds
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isNumber, throttle } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import PQueue from 'p-queue';
|
||||
import pMap from 'p-map';
|
||||
|
@ -228,6 +228,8 @@ import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav.js';
|
|||
import { initialize as initializeDonationService } from './services/donations.js';
|
||||
import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent.js';
|
||||
|
||||
const { isNumber, throttle } = lodash;
|
||||
|
||||
const log = createLogger('background');
|
||||
|
||||
export function isOverHourIntoPast(timestamp: number): boolean {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { find, findLast, first, last } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { BadgeType } from './types.js';
|
||||
import { BadgeImageTheme } from './BadgeImageTheme.js';
|
||||
|
||||
const { find, findLast, first, last } = lodash;
|
||||
|
||||
export function getBadgeImageFileLocalPath(
|
||||
badge: Readonly<undefined | BadgeType>,
|
||||
size: number,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as z from 'zod';
|
||||
import { isEmpty } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { isRecord } from '../util/isRecord.js';
|
||||
import { isNormalNumber } from '../util/isNormalNumber.js';
|
||||
import { createLogger } from '../logging/log.js';
|
||||
|
@ -11,6 +11,8 @@ import { parseBadgeCategory } from './BadgeCategory.js';
|
|||
import { BadgeImageTheme, parseBadgeImageTheme } from './BadgeImageTheme.js';
|
||||
import { safeParseUnknown } from '../util/schemas.js';
|
||||
|
||||
const { isEmpty } = lodash;
|
||||
|
||||
const log = createLogger('parseBadgesFromServer');
|
||||
|
||||
const MAX_BADGES = 1000;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { pick } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import React, { useCallback } from 'react';
|
||||
import type { ListRowProps } from 'react-virtualized';
|
||||
|
||||
|
@ -23,6 +23,8 @@ import { ListTile } from './ListTile.js';
|
|||
import type { ShowToastAction } from '../state/ducks/toast.js';
|
||||
import { SizeObserver } from '../hooks/useSizeObserver.js';
|
||||
|
||||
const { pick } = lodash;
|
||||
|
||||
type OwnProps = {
|
||||
i18n: LocalizerType;
|
||||
contact: Pick<ConversationType, 'id' | 'title' | 'serviceId' | 'pni'>;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { animated, to as interpolate, useSprings } from '@react-spring/web';
|
||||
import { random } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { useReducedMotion } from '../hooks/useReducedMotion.js';
|
||||
import { FunStaticEmoji } from './fun/FunEmoji.js';
|
||||
import { strictAssert } from '../util/assert.js';
|
||||
|
@ -13,6 +13,8 @@ import {
|
|||
isEmojiVariantValue,
|
||||
} from './fun/data/emojis.js';
|
||||
|
||||
const { random } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
emoji: string;
|
||||
onAnimationEnd: () => unknown;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type {
|
||||
ConversationType,
|
||||
ShowConversationType,
|
||||
|
@ -12,6 +12,8 @@ import type { LocalizerType, ThemeType } from '../types/Util.js';
|
|||
import { Modal } from './Modal.js';
|
||||
import { ConversationListItem } from './conversationList/ConversationListItem.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
type PropsType = {
|
||||
groupAdmins: Array<ConversationType>;
|
||||
i18n: LocalizerType;
|
||||
|
|
|
@ -10,7 +10,7 @@ import type {
|
|||
} from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { filterDOMProps } from '@react-aria/utils';
|
||||
import type { AvatarColorType } from '../types/Colors.js';
|
||||
|
@ -28,6 +28,8 @@ import { isBadgeVisible } from '../badges/isBadgeVisible.js';
|
|||
import { SIGNAL_AVATAR_PATH } from '../types/SignalConversation.js';
|
||||
import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('Avatar');
|
||||
|
||||
export enum AvatarBlur {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { isEqual } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { AvatarColorType } from '../types/Colors.js';
|
||||
import type {
|
||||
|
@ -24,6 +24,8 @@ import { isSameAvatarData } from '../util/isSameAvatarData.js';
|
|||
import { missingCaseError } from '../util/missingCaseError.js';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js';
|
||||
|
||||
const { isEqual } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
avatarColor?: AvatarColorType;
|
||||
avatarUrl?: string;
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { AvatarColorType } from '../types/Colors.js';
|
||||
import { AvatarPreview } from './AvatarPreview.js';
|
||||
import { Lightbox } from './Lightbox.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
avatarPlaceholderGradient?: Readonly<[string, string]>;
|
||||
avatarColor?: AvatarColorType;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { chunk } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
|
@ -11,6 +11,8 @@ import type { PropsType } from './AvatarPreview.js';
|
|||
import { AvatarPreview } from './AvatarPreview.js';
|
||||
import { AvatarColors } from '../types/Colors.js';
|
||||
|
||||
const { chunk } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
const TEST_IMAGE = new Uint8Array(
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { CSSProperties } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { createLogger } from '../logging/log.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -14,6 +14,8 @@ import { getInitials } from '../util/getInitials.js';
|
|||
import { imagePathToBytes } from '../util/imagePathToBytes.js';
|
||||
import { type ConversationType } from '../state/ducks/conversations.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('AvatarPreview');
|
||||
|
||||
export type PropsType = {
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {
|
|||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import * as grapheme from '../util/grapheme.js';
|
||||
import { AvatarColorPicker } from './AvatarColorPicker.js';
|
||||
|
@ -25,6 +25,8 @@ import {
|
|||
getFontSizes,
|
||||
} from '../util/avatarTextSizeCalculator.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
type DoneHandleType = (
|
||||
avatarBuffer: Uint8Array,
|
||||
avatarData: AvatarDataType
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
|
||||
import type { ChangeEventHandler } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { processImageFile } from '../util/processImageFile.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
className: string;
|
||||
i18n: LocalizerType;
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { strictAssert } from '../util/assert.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
export function BadgeCarouselIndex({
|
||||
currentIndex,
|
||||
totalCount,
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
|
||||
import type { MouseEvent } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { AvatarDataType } from '../types/Avatar.js';
|
||||
import { BetterAvatarBubble } from './BetterAvatarBubble.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { Spinner } from './Spinner.js';
|
||||
import { avatarDataToBytes } from '../util/avatarDataToBytes.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
type AvatarSize = 48 | 80;
|
||||
|
||||
export type PropsType = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useEffect } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.js';
|
||||
import { CallScreen } from './CallScreen.js';
|
||||
|
@ -61,6 +61,8 @@ import {
|
|||
import type { NotificationProfileType } from '../types/NotificationProfile.js';
|
||||
import { strictAssert } from '../util/assert.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('CallManager');
|
||||
|
||||
const GROUP_CALL_RING_DURATION = 60 * 1000;
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
|
||||
import React from 'react';
|
||||
import { animated, useSpring } from '@react-spring/web';
|
||||
import { random } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Emojify } from './conversation/Emojify.js';
|
||||
import { useReducedMotion } from '../hooks/useReducedMotion.js';
|
||||
|
||||
const { random } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
values: Array<string>;
|
||||
onAnimationEnd?: () => unknown;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { sample, shuffle, times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import type { Meta } from '@storybook/react';
|
||||
|
@ -36,6 +36,8 @@ import { CallingToastProvider, useCallingToasts } from './CallingToast.js';
|
|||
import type { CallingImageDataCache } from './CallManager.js';
|
||||
import { MINUTE } from '../util/durations/index.js';
|
||||
|
||||
const { sample, shuffle, times } = lodash;
|
||||
|
||||
const MAX_PARTICIPANTS = 75;
|
||||
const LOCAL_DEMUX_ID = 1;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { ReactNode } from 'react';
|
||||
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import { isEqual, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
import type {
|
||||
|
@ -99,6 +99,8 @@ import {
|
|||
import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js';
|
||||
import { BeforeNavigateResponse } from '../services/BeforeNavigate.js';
|
||||
|
||||
const { isEqual, noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
activeCall: ActiveCallType;
|
||||
approveUser: (payload: PendingUserActionPayloadType) => void;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { sample } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import type { Meta } from '@storybook/react';
|
||||
|
@ -15,6 +15,8 @@ import { getDefaultConversation } from '../test-helpers/getDefaultConversation.j
|
|||
import type { CallLinkType } from '../types/CallLink.js';
|
||||
import { CallLinkRestrictions } from '../types/CallLink.js';
|
||||
|
||||
const { sample } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
const OUR_ACI = generateAci();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { partition } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Avatar, AvatarSize } from './Avatar.js';
|
||||
import { ContactName } from './conversation/ContactName.js';
|
||||
import { InContactsIcon } from './InContactsIcon.js';
|
||||
|
@ -22,6 +22,8 @@ import { Modal } from './Modal.js';
|
|||
import { Theme } from '../util/theme.js';
|
||||
import { ConfirmationDialog } from './ConfirmationDialog.js';
|
||||
|
||||
const { partition } = lodash;
|
||||
|
||||
const MAX_UNKNOWN_AVATARS_COUNT = 3;
|
||||
|
||||
type ParticipantType = ConversationType & {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
|
@ -20,6 +20,8 @@ import { CallingToastProvider } from './CallingToast.js';
|
|||
import { CallMode } from '../types/CallDisposition.js';
|
||||
import { getDefaultCallLinkConversation } from '../test-helpers/fakeCallLink.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
const camera = {
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
|
||||
import type { ReactChild } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { Button, ButtonVariant } from './Button.js';
|
||||
import { Spinner } from './Spinner.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export enum CallingLobbyJoinButtonVariant {
|
||||
CallIsFull = 'CallIsFull',
|
||||
Join = 'Join',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* eslint-disable react/no-array-index-key */
|
||||
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import { animated, useSpring } from '@react-spring/web';
|
||||
import { Avatar, AvatarSize } from './Avatar.js';
|
||||
|
@ -26,6 +26,8 @@ import { usePrevious } from '../hooks/usePrevious.js';
|
|||
import { useReducedMotion } from '../hooks/useReducedMotion.js';
|
||||
import { drop } from '../util/drop.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
enum ConfirmDialogState {
|
||||
None = 'None',
|
||||
ApproveAll = 'ApproveAll',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import { AvatarColors } from '../types/Colors.js';
|
||||
|
@ -23,6 +23,8 @@ import { MINUTE } from '../util/durations/index.js';
|
|||
import type { SetRendererCanvasType } from '../state/ducks/calling.js';
|
||||
import { createCallParticipant } from '../test-helpers/createCallParticipant.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
const videoScreenshot = new Image(300, 400);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { minBy, debounce, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
|
||||
|
@ -27,6 +27,8 @@ import type { ConversationType } from '../state/ducks/conversations.js';
|
|||
import { Avatar, AvatarSize } from './Avatar.js';
|
||||
import { AvatarColors } from '../types/Colors.js';
|
||||
|
||||
const { minBy, debounce, noop } = lodash;
|
||||
|
||||
enum PositionMode {
|
||||
BeingDragged,
|
||||
SnapToBottom,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import { clamp, isNumber, maxBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
import { Avatar, AvatarSize } from './Avatar.js';
|
||||
import { CallBackgroundBlur } from './CallBackgroundBlur.js';
|
||||
|
@ -33,6 +33,8 @@ import {
|
|||
PIP_WIDTH_NORMAL,
|
||||
} from './CallingPip.js';
|
||||
|
||||
const { clamp, isNumber, maxBy } = lodash;
|
||||
|
||||
function BlurredBackground({
|
||||
activeCall,
|
||||
activeGroupCallSpeaker,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js';
|
||||
import type { PropsType } from './CallingPreCallInfo.js';
|
||||
|
@ -13,6 +13,8 @@ import { generateAci } from '../types/ServiceId.js';
|
|||
import { FAKE_CALL_LINK } from '../test-helpers/fakeCallLink.js';
|
||||
import { callLinkToConversation } from '../util/callLinks.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
const getDefaultGroupConversation = () =>
|
||||
getDefaultConversation({
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { partition } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { ConversationType } from '../state/ducks/conversations.js';
|
||||
import type { CallingConversationType } from '../types/Calling.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -11,6 +11,8 @@ import { getParticipantName } from '../util/callingGetParticipantName.js';
|
|||
import { missingCaseError } from '../util/missingCaseError.js';
|
||||
import { UserText } from './UserText.js';
|
||||
|
||||
const { partition } = lodash;
|
||||
|
||||
export enum RingMode {
|
||||
WillNotRing,
|
||||
WillRing,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import type { Meta } from '@storybook/react';
|
||||
|
@ -18,6 +18,8 @@ import type { ConversationType } from '../state/ducks/conversations.js';
|
|||
import { AvatarColors } from '../types/Colors.js';
|
||||
import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const MAX_HANDS = 20;
|
||||
const LOCAL_DEMUX_ID = 1;
|
||||
const NAMES = [
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { groupBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Button, ButtonVariant } from './Button.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { Modal } from './Modal.js';
|
||||
|
@ -11,6 +11,8 @@ import type { PresentedSource, PresentableSource } from '../types/Calling.js';
|
|||
import { Theme } from '../util/theme.js';
|
||||
import { strictAssert } from '../util/assert.js';
|
||||
|
||||
const { groupBy } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
presentingSourcesAvailable: ReadonlyArray<PresentableSource>;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { ChangeEvent } from 'react';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { partition } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { ListRowProps } from 'react-virtualized';
|
||||
import { List } from 'react-virtualized';
|
||||
import classNames from 'classnames';
|
||||
|
@ -25,6 +25,8 @@ import {
|
|||
getTooltipContent,
|
||||
} from './conversation/InAnotherCallTooltip.js';
|
||||
|
||||
const { partition } = lodash;
|
||||
|
||||
type CallsNewCallProps = Readonly<{
|
||||
hasActiveCall: boolean;
|
||||
allConversations: ReadonlyArray<ConversationType>;
|
||||
|
|
|
@ -10,9 +10,9 @@ import {
|
|||
matchText,
|
||||
matchNewline,
|
||||
matchBreak,
|
||||
} from '@signalapp/quill-cjs/modules/clipboard';
|
||||
import Emitter from '@signalapp/quill-cjs/core/emitter';
|
||||
import type { Context } from '@signalapp/quill-cjs/modules/keyboard';
|
||||
} from '@signalapp/quill-cjs/modules/clipboard.js';
|
||||
import Emitter from '@signalapp/quill-cjs/core/emitter.js';
|
||||
import type { Context } from '@signalapp/quill-cjs/modules/keyboard.js';
|
||||
import type { Range as RangeStatic } from '@signalapp/quill-cjs';
|
||||
|
||||
import { MentionCompletion } from '../quill/mentions/completion.js';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useEscapeHandling } from '../hooks/useEscapeHandling.js';
|
||||
import type { HideToastAction, ShowToastAction } from '../state/ducks/toast.js';
|
||||
|
@ -15,6 +15,8 @@ import { durationToPlaybackText } from '../util/durationToPlaybackText.js';
|
|||
import { ConfirmationDialog } from './ConfirmationDialog.js';
|
||||
import { RecordingComposer } from './RecordingComposer.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type Props = {
|
||||
i18n: LocalizerType;
|
||||
onCancel: () => void;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
|
@ -13,6 +13,8 @@ import { ContactPill } from './ContactPill.js';
|
|||
import { gifUrl } from '../storybook/Fixtures.js';
|
||||
import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -7,7 +7,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|||
import { createPortal } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import { usePopper } from 'react-popper';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { Theme } from '../util/theme.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -15,6 +15,8 @@ import { getClassNamesFor } from '../util/getClassNamesFor.js';
|
|||
import { themeClassName } from '../util/theme.js';
|
||||
import { handleOutsideClick } from '../util/handleOutsideClick.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type ContextMenuOptionType<T> = Readonly<{
|
||||
description?: string;
|
||||
icon?: string;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useContext } from 'react';
|
||||
import { times, omit } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
|
@ -17,6 +17,8 @@ import { ThemeType } from '../types/Util.js';
|
|||
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js';
|
||||
import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId.js';
|
||||
|
||||
const { times, omit } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -5,7 +5,7 @@ import type { ReactNode } from 'react';
|
|||
import React, { useCallback } from 'react';
|
||||
import type { ListRowRenderer } from 'react-virtualized';
|
||||
import classNames from 'classnames';
|
||||
import { get, pick } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { missingCaseError } from '../util/missingCaseError.js';
|
||||
import { assertDev } from '../util/assert.js';
|
||||
|
@ -39,6 +39,8 @@ import { ListView } from './ListView.js';
|
|||
import { Button, ButtonVariant } from './Button.js';
|
||||
import { ListTile } from './ListTile.js';
|
||||
|
||||
const { get, pick } = lodash;
|
||||
|
||||
export enum RowType {
|
||||
ArchiveButton = 'ArchiveButton',
|
||||
Blank = 'Blank',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { usePopper } from 'react-popper';
|
||||
import { isEqual, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { Modal } from './Modal.js';
|
||||
|
@ -23,6 +23,8 @@ import { FunEmojiPicker } from './fun/FunEmojiPicker.js';
|
|||
import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js';
|
||||
import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js';
|
||||
|
||||
const { isEqual, noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
draftPreferredReactions: ReadonlyArray<string>;
|
||||
hadSaveError: boolean;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useState, useRef } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { AttachmentType } from '../types/Attachment.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -17,6 +17,8 @@ import { isSameDay } from '../util/timestamp.js';
|
|||
import { TimelineDateHeader } from './conversation/TimelineDateHeader.js';
|
||||
import { drop } from '../util/drop.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
closeEditHistoryModal: () => unknown;
|
||||
editHistoryMessages: Array<MessagePropsType>;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { memoize, times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { PropsType } from './GroupCallOverflowArea.js';
|
||||
|
@ -14,6 +14,8 @@ import { generateAci } from '../types/ServiceId.js';
|
|||
import type { CallingImageDataCache } from './CallManager.js';
|
||||
import { MINUTE } from '../util/durations/index.js';
|
||||
|
||||
const { memoize, times } = lodash;
|
||||
|
||||
const MAX_PARTICIPANTS = 32;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { memoize } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { PropsType } from './GroupCallRemoteParticipant.js';
|
||||
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js';
|
||||
|
@ -12,6 +12,8 @@ import { generateAci } from '../types/ServiceId.js';
|
|||
import type { CallingImageDataCache } from './CallManager.js';
|
||||
import { MINUTE } from '../util/durations/index.js';
|
||||
|
||||
const { memoize } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
type OverridePropsType = {
|
||||
|
|
|
@ -10,7 +10,7 @@ import React, {
|
|||
useEffect,
|
||||
} from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { debounce, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
import type { GroupCallRemoteParticipantType } from '../types/Calling.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -32,6 +32,8 @@ import { isOlderThan } from '../util/timestamp.js';
|
|||
import type { CallingImageDataCache } from './CallManager.js';
|
||||
import { usePrevious } from '../hooks/usePrevious.js';
|
||||
|
||||
const { debounce, noop } = lodash;
|
||||
|
||||
const MAX_TIME_TO_SHOW_STALE_VIDEO_FRAMES = 10000;
|
||||
const MAX_TIME_TO_SHOW_STALE_SCREENSHARE_FRAMES = 60000;
|
||||
const DELAY_TO_SHOW_MISSING_MEDIA_KEYS = 5000;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useState, useMemo, useEffect } from 'react';
|
||||
import { clamp, chunk, maxBy, flatten, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { VideoFrameSource } from '@signalapp/ringrtc';
|
||||
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js';
|
||||
import {
|
||||
|
@ -29,6 +29,8 @@ import { SizeObserver } from '../hooks/useSizeObserver.js';
|
|||
import { strictAssert } from '../util/assert.js';
|
||||
import type { CallingImageDataCache } from './CallManager.js';
|
||||
|
||||
const { clamp, chunk, maxBy, flatten, noop } = lodash;
|
||||
|
||||
const log = createLogger('GroupCallRemoteParticipants');
|
||||
|
||||
const SMALL_TILES_MIN_HEIGHT = 80;
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
|
||||
import React, { useMemo } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { take } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { I18n } from './I18n.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { UserText } from './UserText.js';
|
||||
import type { GroupV2Membership } from './conversation/conversation-details/ConversationDetailsMembershipList.js';
|
||||
|
||||
const { take } = lodash;
|
||||
|
||||
type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
nameClassName?: string;
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
|
||||
import React, { useState, useEffect, useMemo } from 'react';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { Inbox } from './Inbox.js';
|
||||
import type { PropsType } from './Inbox.js';
|
||||
import { DAY, SECOND } from '../util/durations/index.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { useEffect, useCallback, useMemo, useRef } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { isNumber } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LeftPaneHelper, ToFindType } from './leftPane/LeftPaneHelper.js';
|
||||
import { FindDirection } from './leftPane/LeftPaneHelper.js';
|
||||
|
@ -61,6 +61,8 @@ import { getServerAlertDialog } from './ServerAlerts.js';
|
|||
import { NavTab, SettingsPage, ProfileEditorPage } from '../types/Nav.js';
|
||||
import type { Location } from '../types/Nav.js';
|
||||
|
||||
const { isNumber } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
backupMediaDownloadProgress: {
|
||||
isBackupMediaEnabled: boolean;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { useState } from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { PropsType } from './Lightbox.js';
|
||||
import { Lightbox } from './Lightbox.js';
|
||||
|
@ -19,6 +19,8 @@ import {
|
|||
|
||||
import { fakeAttachment } from '../test-helpers/fakeAttachment.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -5,7 +5,7 @@ import type { ReactNode } from 'react';
|
|||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { useSpring, animated, to } from '@react-spring/web';
|
||||
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
|
@ -36,6 +36,8 @@ import { SECOND } from '../util/durations/index.js';
|
|||
import { Toast } from './Toast.js';
|
||||
import { isAbortError } from '../util/isAbortError.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('Lightbox');
|
||||
|
||||
export type PropsType = {
|
||||
|
|
|
@ -13,7 +13,7 @@ import classNames from 'classnames';
|
|||
import { createPortal } from 'react-dom';
|
||||
import { fabric } from 'fabric';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { get, has, noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type {
|
||||
EmojiPickDataType,
|
||||
Props as EmojiPickerProps,
|
||||
|
@ -73,6 +73,8 @@ import { drop } from '../util/drop.js';
|
|||
import type { FunTimeStickerStyle } from './fun/constants.js';
|
||||
import * as Errors from '../types/errors.js';
|
||||
|
||||
const { get, has, noop } = lodash;
|
||||
|
||||
const log = createLogger('MediaEditor');
|
||||
|
||||
export type MediaEditorResultType = Readonly<{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { KeyboardEvent } from 'react';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { createPortal } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import { Manager, Popper, Reference } from 'react-popper';
|
||||
|
@ -11,6 +11,8 @@ import type { LocalizerType } from '../types/Util.js';
|
|||
import { useRefMerger } from '../hooks/useRefMerger.js';
|
||||
import { handleOutsideClick } from '../util/handleOutsideClick.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
conversationId: string;
|
||||
i18n: LocalizerType;
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import { Button } from './Button.js';
|
||||
import type { ModalPropsType } from './Modal.js';
|
||||
import { Modal } from './Modal.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import type { ReactElement, ReactNode } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { animated } from '@react-spring/web';
|
||||
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
@ -23,6 +23,8 @@ import {
|
|||
useScrollObserver,
|
||||
} from '../hooks/useSizeObserver.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('Modal');
|
||||
|
||||
type PropsType = {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { createPortal } from 'react-dom';
|
|||
import type { SpringValues } from '@react-spring/web';
|
||||
import { animated } from '@react-spring/web';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { FocusScope } from 'react-aria';
|
||||
import type { ModalConfigType } from '../hooks/useAnimated.js';
|
||||
import type { Theme } from '../util/theme.js';
|
||||
|
@ -18,6 +18,8 @@ import { usePrevious } from '../hooks/usePrevious.js';
|
|||
import { handleOutsideClick } from '../util/handleOutsideClick.js';
|
||||
import { createLogger } from '../logging/log.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('ModalHost');
|
||||
|
||||
export const ModalContainerContext = React.createContext<HTMLElement | null>(
|
||||
|
|
|
@ -6,7 +6,7 @@ import React, { useState } from 'react';
|
|||
import type { MutableRefObject } from 'react';
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { shuffle } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Preferences } from './Preferences.js';
|
||||
import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors.js';
|
||||
import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode.js';
|
||||
|
@ -45,6 +45,8 @@ import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/Pre
|
|||
import { PreferencesEditChatFolderPage } from './preferences/chatFolders/PreferencesEditChatFoldersPage.js';
|
||||
import { CHAT_FOLDER_DEFAULTS } from '../types/ChatFolder.js';
|
||||
|
||||
const { shuffle } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
const me = {
|
||||
|
|
|
@ -10,7 +10,7 @@ import React, {
|
|||
useState,
|
||||
useId,
|
||||
} from 'react';
|
||||
import { isNumber, noop, partition } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||
import type { MutableRefObject, ReactNode } from 'react';
|
||||
|
@ -99,6 +99,8 @@ import { isChatFoldersEnabled } from '../types/ChatFolder.js';
|
|||
import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.js';
|
||||
import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.js';
|
||||
|
||||
const { isNumber, noop, partition } = lodash;
|
||||
|
||||
type CheckboxChangeHandlerType = (value: boolean) => unknown;
|
||||
type SelectChangeHandlerType<T = string | number> = (value: T) => unknown;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { groupBy, sortBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { MutableRefObject, ReactNode } from 'react';
|
||||
import { ListBox, ListBoxItem } from 'react-aria-components';
|
||||
|
@ -55,6 +55,8 @@ import { drop } from '../util/drop.js';
|
|||
import { DonationsOfflineTooltip } from './conversation/DonationsOfflineTooltip.js';
|
||||
import { getInProgressDonation } from '../util/donations.js';
|
||||
|
||||
const { groupBy, sortBy } = lodash;
|
||||
|
||||
const log = createLogger('PreferencesDonations');
|
||||
|
||||
type PropsExternalType = {
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {
|
|||
useState,
|
||||
useRef,
|
||||
} from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import type { LocalizerType } from '../types/I18N.js';
|
||||
|
@ -35,6 +35,8 @@ import type {
|
|||
} from '../util/os/promptOSAuthMain.js';
|
||||
import { ConfirmationDialog } from './ConfirmationDialog.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export function PreferencesLocalBackups({
|
||||
accountEntropyPool,
|
||||
backupKeyViewed,
|
||||
|
|
|
@ -4,12 +4,14 @@
|
|||
import classNames from 'classnames';
|
||||
import React, { type ReactNode, useMemo } from 'react';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import {
|
||||
CircleCheckbox,
|
||||
Variant as CircleCheckboxVariant,
|
||||
} from './CircleCheckbox.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export function SettingsRow({
|
||||
children,
|
||||
title,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { Avatar, AvatarSize } from './Avatar.js';
|
||||
|
@ -25,6 +25,8 @@ import type { ServiceIdString } from '../types/ServiceId.js';
|
|||
import type { StoryDistributionIdString } from '../types/StoryDistributionId.js';
|
||||
import { UserText } from './UserText.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export enum SafetyNumberChangeSource {
|
||||
InitiateCall = 'InitiateCall',
|
||||
JoinCall = 'JoinCall',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { noop, sortBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { SearchInput } from './SearchInput.js';
|
||||
import { filterAndSortConversations } from '../util/filterAndSortConversations.js';
|
||||
|
@ -44,6 +44,8 @@ import { makeObjectUrl, revokeObjectUrl } from '../types/VisualAttachment.js';
|
|||
import { UserText } from './UserText.js';
|
||||
import { Theme } from '../util/theme.js';
|
||||
|
||||
const { noop, sortBy } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
draftAttachment: AttachmentType;
|
||||
candidateConversations: Array<ConversationType>;
|
||||
|
|
|
@ -2,12 +2,14 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { take } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { I18n } from './I18n.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import { UserText } from './UserText.js';
|
||||
|
||||
const { take } = lodash;
|
||||
|
||||
type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
nameClassName?: string;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { createRef } from 'react';
|
||||
import Quill from '@signalapp/quill-cjs';
|
||||
import Emitter from '@signalapp/quill-cjs/core/emitter';
|
||||
import Emitter from '@signalapp/quill-cjs/core/emitter.js';
|
||||
import type { Delta } from '@signalapp/quill-cjs';
|
||||
|
||||
export type Props = {
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {
|
|||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { ConversationType } from '../state/ducks/conversations.js';
|
||||
import type { ConversationWithStoriesType } from '../state/selectors/conversations.js';
|
||||
|
@ -45,6 +45,8 @@ import { strictAssert } from '../util/assert.js';
|
|||
import { UserText } from './UserText.js';
|
||||
import { SizeObserver } from '../hooks/useSizeObserver.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
candidateConversations: Array<ConversationType>;
|
||||
distributionLists: Array<StoryDistributionListWithMembersDataType>;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { get, has } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { createPortal } from 'react-dom';
|
||||
import type { AttachmentType } from '../types/Attachment.js';
|
||||
|
@ -25,6 +25,8 @@ import { TextStoryCreator } from './TextStoryCreator.js';
|
|||
import type { DraftBodyRanges } from '../types/BodyRange.js';
|
||||
import type { processAttachment } from '../util/processAttachment.js';
|
||||
|
||||
const { get, has } = lodash;
|
||||
|
||||
function usePortalElement(testid: string): HTMLDivElement | null {
|
||||
const [element, setElement] = useState<HTMLDivElement | null>(null);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import React from 'react';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { PropsType } from './StoryImage.js';
|
||||
|
@ -15,6 +15,8 @@ import {
|
|||
} from '../test-helpers/fakeAttachment.js';
|
||||
import { VIDEO_MP4 } from '../types/MIME.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { unescape } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
|
@ -11,6 +11,8 @@ import { CurveType, Image } from './conversation/Image.js';
|
|||
import { isImageAttachment } from '../types/Attachment.js';
|
||||
import { getSafeDomain } from '../types/LinkPreview.js';
|
||||
|
||||
const { unescape } = lodash;
|
||||
|
||||
export type Props = LinkPreviewForUIType & {
|
||||
forceCompactMode?: boolean;
|
||||
i18n: LocalizerType;
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {
|
|||
useState,
|
||||
} from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop, orderBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { DraftBodyRanges } from '../types/BodyRange.js';
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import type { ConversationType } from '../state/ducks/conversations.js';
|
||||
|
@ -43,6 +43,8 @@ import { FunEmojiPickerButton } from './fun/FunButton.js';
|
|||
import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js';
|
||||
|
||||
const { noop, orderBy } = lodash;
|
||||
|
||||
// Menu is disabled so these actions are inaccessible. We also don't support
|
||||
// link previews, tap to view messages, attachments, or gifts. Just regular
|
||||
// text messages and reactions.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { usePopper } from 'react-popper';
|
||||
import { FocusScope } from 'react-aria';
|
||||
import type { EmojiPickDataType } from './emoji/EmojiPicker.js';
|
||||
|
@ -37,6 +37,8 @@ import { FunEmojiPickerButton } from './fun/FunButton.js';
|
|||
import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = {
|
||||
debouncedMaybeGrabLinkPreview: (
|
||||
message: string,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, { useRef } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Manager, Reference, Popper } from 'react-popper';
|
||||
import type { StrictModifiers } from '@popperjs/core';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
@ -13,6 +13,8 @@ import { refMerger } from '../util/refMerger.js';
|
|||
import { offsetDistanceModifier } from '../util/popperUtil.js';
|
||||
import { getInteractionMode } from '../services/InteractionMode.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
type EventWrapperPropsType = {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {
|
|||
useRef,
|
||||
} from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../types/Util.js';
|
||||
import type { UsernameReservationType } from '../types/Username.js';
|
||||
|
@ -35,6 +35,8 @@ import { Modal } from './Modal.js';
|
|||
import { Button, ButtonVariant } from './Button.js';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsDataType = Readonly<{
|
||||
i18n: LocalizerType;
|
||||
currentUsername?: string;
|
||||
|
|
|
@ -5,7 +5,7 @@ import React, { useCallback, useState, useEffect, useRef } from 'react';
|
|||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import classnames from 'classnames';
|
||||
import { changeDpiBlob } from 'changedpi';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { SignalService as Proto } from '../protobuf/index.js';
|
||||
import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.js';
|
||||
|
@ -24,6 +24,8 @@ import { Spinner } from './Spinner.js';
|
|||
import { BrandedQRCode } from './BrandedQRCode.js';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
export type PropsType = Readonly<{
|
||||
i18n: LocalizerType;
|
||||
link?: string;
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { sortBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type {
|
||||
HydratedBodyRangeMention,
|
||||
BodyRange,
|
||||
} from '../../types/BodyRange.js';
|
||||
import { AtMention } from './AtMention.js';
|
||||
|
||||
const { sortBy } = lodash;
|
||||
|
||||
export type Props = {
|
||||
mentions?: ReadonlyArray<HydratedBodyRangeMention>;
|
||||
direction?: 'incoming' | 'outgoing';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { ContextMenuTrigger } from 'react-contextmenu';
|
||||
|
||||
import { SystemMessage, SystemMessageKind } from './SystemMessage.js';
|
||||
|
@ -40,6 +40,8 @@ import { isMoreRecentThan } from '../../util/timestamp.js';
|
|||
import { InAnotherCallTooltip } from './InAnotherCallTooltip.js';
|
||||
import type { InteractionModeType } from '../../state/ducks/conversations.js';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
const log = createLogger('CallingNotification');
|
||||
|
||||
export type PropsActionsType = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { times } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js';
|
||||
|
@ -11,6 +11,8 @@ import { ContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.js';
|
|||
import { ContactSpoofingType } from '../../util/contactSpoofing.js';
|
||||
import { ThemeType } from '../../types/Util.js';
|
||||
|
||||
const { times } = lodash;
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
import { compact, flatten } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { ContactName } from './ContactName.js';
|
||||
import { SystemMessage } from './SystemMessage.js';
|
||||
|
@ -13,6 +13,8 @@ import type { LocalizerType } from '../../types/Util.js';
|
|||
import { missingCaseError } from '../../util/missingCaseError.js';
|
||||
import type { ConversationType } from '../../state/ducks/conversations.js';
|
||||
|
||||
const { compact, flatten } = lodash;
|
||||
|
||||
export type ChangeType = 'add' | 'remove' | 'name' | 'avatar' | 'general';
|
||||
|
||||
type Change = {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { ReactElement, ReactNode } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { get } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
|
||||
import { createLogger } from '../../logging/log.js';
|
||||
|
@ -31,6 +31,8 @@ import { renderChange } from '../../groupChange.js';
|
|||
import { Modal } from '../Modal.js';
|
||||
import { ConfirmationDialog } from '../ConfirmationDialog.js';
|
||||
|
||||
const { get } = lodash;
|
||||
|
||||
const log = createLogger('GroupV2Change');
|
||||
|
||||
export type PropsDataType = ReadonlyDeep<{
|
||||
|
|
|
@ -13,9 +13,9 @@ import React, { forwardRef, useRef } from 'react';
|
|||
import { createPortal } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import getDirection from 'direction';
|
||||
import { drop, take, unescape } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { Manager, Popper, Reference } from 'react-popper';
|
||||
import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow';
|
||||
import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow.js';
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
import type {
|
||||
ConversationType,
|
||||
|
@ -124,6 +124,8 @@ import {
|
|||
} from '../fun/data/emojis.js';
|
||||
import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.js';
|
||||
|
||||
const { drop, take, unescape } = lodash;
|
||||
|
||||
const log = createLogger('Message');
|
||||
|
||||
const GUESS_METADATA_WIDTH_TIMESTAMP_SIZE = 16;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue