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