Shared Components Restructure, Cherry Picked | Room Timeline (#32916)
* refactor(shared-components): move room timeline tree * refactor(web): move room timeline viewmodels * Prettier FIx * fix(refactor): align newer imports with room timeline paths * test(shared-components): add room timeline visual baselines * test(shared-components): drop stale timeline baseline paths
@@ -56,7 +56,7 @@ import { MainGrouper } from "./grouper/MainGrouper";
|
||||
import { CreationGrouper } from "./grouper/CreationGrouper";
|
||||
import { _t } from "../../languageHandler";
|
||||
import { getLateEventInfo } from "./grouper/LateEventGrouper";
|
||||
import { DateSeparatorViewModel } from "../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
||||
const continuedTypes = [EventType.Sticker, EventType.RoomMessage];
|
||||
|
||||
@@ -140,7 +140,7 @@ import { type FocusMessageSearchPayload } from "../../dispatcher/payloads/FocusM
|
||||
import { isRoomEncrypted } from "../../hooks/useIsEncrypted";
|
||||
import { type RoomViewStore } from "../../stores/RoomViewStore.tsx";
|
||||
import { RoomStatusBarViewModel } from "../../viewmodels/room/RoomStatusBar.ts";
|
||||
import { EncryptionEventViewModel } from "../../viewmodels/event-tiles/EncryptionEventViewModel.ts";
|
||||
import { EncryptionEventViewModel } from "../../viewmodels/room/timeline/event-tile/EncryptionEventViewModel.ts";
|
||||
import { ModuleApi } from "../../modules/Api.ts";
|
||||
|
||||
const DEBUG = false;
|
||||
|
||||
@@ -18,7 +18,7 @@ import DMRoomMap from "../../../utils/DMRoomMap";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import NewRoomIntro from "../../views/rooms/NewRoomIntro";
|
||||
import GenericEventListSummary from "../../views/elements/GenericEventListSummary";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
// Wrap initial room creation events into a GenericEventListSummary
|
||||
// Grouping only events sent by the same user that sent the `m.room.create` and only until
|
||||
|
||||
@@ -17,7 +17,7 @@ import { hasText } from "../../../TextForEvent";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import HistoryTile from "../../views/rooms/HistoryTile";
|
||||
import EventListSummary from "../../views/elements/EventListSummary";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
const groupedStateEvents = [
|
||||
EventType.RoomMember,
|
||||
|
||||
@@ -19,7 +19,7 @@ import BaseDialog from "./BaseDialog";
|
||||
import ScrollPanel from "../../structures/ScrollPanel";
|
||||
import Spinner from "../elements/Spinner";
|
||||
import EditHistoryMessage from "../messages/EditHistoryMessage";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
interface IProps {
|
||||
mxEvent: MatrixEvent;
|
||||
|
||||
@@ -42,7 +42,7 @@ import { useDownloadMedia } from "../../../hooks/useDownloadMedia.ts";
|
||||
import {
|
||||
MessageTimestampViewModel,
|
||||
type MessageTimestampViewModelProps,
|
||||
} from "../../../viewmodels/message-body/MessageTimestampViewModel.ts";
|
||||
} from "../../../viewmodels/room/timeline/event-tile/timestamp/MessageTimestampViewModel.ts";
|
||||
|
||||
// Max scale to keep gaps around the image
|
||||
const MAX_SCALE = 0.95;
|
||||
|
||||
@@ -19,7 +19,7 @@ import { type IBodyProps } from "./IBodyProps";
|
||||
import { PlaybackManager } from "../../../audio/PlaybackManager";
|
||||
import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext";
|
||||
import MediaProcessingError from "./shared/MediaProcessingError";
|
||||
import { AudioPlayerViewModel } from "../../../viewmodels/audio/AudioPlayerViewModel";
|
||||
import { AudioPlayerViewModel } from "../../../viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel";
|
||||
import { FileBodyFactory, renderMBody } from "./MBodyFactory";
|
||||
|
||||
interface IState {
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import { type IBodyProps } from "./IBodyProps";
|
||||
import RoomContext from "../../../contexts/RoomContext";
|
||||
import { LocalDeviceVerificationStateContext } from "../../../contexts/LocalDeviceVerificationStateContext";
|
||||
import { DecryptionFailureBodyViewModel } from "../../../viewmodels/message-body/DecryptionFailureBodyViewModel";
|
||||
import { DecryptionFailureBodyViewModel } from "../../../viewmodels/room/timeline/event-tile/body/DecryptionFailureBodyViewModel";
|
||||
import { FileBodyViewModel } from "../../../viewmodels/message-body/FileBodyViewModel";
|
||||
import { RedactedBodyViewModel } from "../../../viewmodels/message-body/RedactedBodyViewModel";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import React, { type JSX, useEffect } from "react";
|
||||
import { type MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix";
|
||||
import { useCreateAutoDisposedViewModel, DisambiguatedProfileView } from "@element-hq/web-shared-components";
|
||||
|
||||
import { DisambiguatedProfileViewModel } from "../../../viewmodels/profile/DisambiguatedProfileViewModel";
|
||||
import { DisambiguatedProfileViewModel } from "../../../viewmodels/room/timeline/event-tile/DisambiguatedProfileViewModel";
|
||||
import { useRoomMemberProfile } from "../../../hooks/room/useRoomMemberProfile";
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -108,9 +108,12 @@ import SettingsStore from "../../../settings/SettingsStore";
|
||||
import {
|
||||
MessageTimestampViewModel,
|
||||
type MessageTimestampViewModelProps,
|
||||
} from "../../../viewmodels/message-body/MessageTimestampViewModel.ts";
|
||||
import { ReactionsRowButtonViewModel } from "../../../viewmodels/message-body/ReactionsRowButtonViewModel";
|
||||
import { MAX_ITEMS_WHEN_LIMITED, ReactionsRowViewModel } from "../../../viewmodels/message-body/ReactionsRowViewModel";
|
||||
} from "../../../viewmodels/room/timeline/event-tile/timestamp/MessageTimestampViewModel.ts";
|
||||
import { ReactionsRowButtonViewModel } from "../../../viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel";
|
||||
import {
|
||||
MAX_ITEMS_WHEN_LIMITED,
|
||||
ReactionsRowViewModel,
|
||||
} from "../../../viewmodels/room/timeline/event-tile/reactions/ReactionsRowViewModel";
|
||||
import { useMatrixClientContext } from "../../../contexts/MatrixClientContext";
|
||||
import { DecryptionFailureBodyFactory, RedactedBodyFactory } from "../messages/MBodyFactory";
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { _t } from "../../../../../languageHandler";
|
||||
import { MemberTileView } from "./common/MemberTileView";
|
||||
import { InvitedIconView } from "./common/InvitedIconView";
|
||||
import { type MemberWithSeparator } from "../../../../viewmodels/memberlist/MemberListViewModel";
|
||||
import { DisambiguatedProfileViewModel } from "../../../../../viewmodels/profile/DisambiguatedProfileViewModel";
|
||||
import { DisambiguatedProfileViewModel } from "../../../../../viewmodels/room/timeline/event-tile/DisambiguatedProfileViewModel";
|
||||
|
||||
interface IProps {
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import type LegacyCallEventGrouper from "../../structures/LegacyCallEventGrouper
|
||||
import { buildLegacyCallEventGroupers } from "../../structures/LegacyCallEventGrouper";
|
||||
import { haveRendererForEvent } from "../../../events/EventTileFactory";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
interface IProps {
|
||||
// a list of strings to be highlighted in the results
|
||||
|
||||
@@ -46,8 +46,8 @@ import ViewSourceEvent from "../components/views/messages/ViewSourceEvent";
|
||||
import { shouldDisplayAsBeaconTile } from "../utils/beacon/timeline";
|
||||
import { type IBodyProps } from "../components/views/messages/IBodyProps";
|
||||
import { ModuleApi } from "../modules/Api";
|
||||
import { EncryptionEventViewModel } from "../viewmodels/event-tiles/EncryptionEventViewModel";
|
||||
import { TextualEventViewModel } from "../viewmodels/event-tiles/TextualEventViewModel";
|
||||
import { EncryptionEventViewModel } from "../viewmodels/room/timeline/event-tile/EncryptionEventViewModel";
|
||||
import { TextualEventViewModel } from "../viewmodels/room/timeline/event-tile/TextualEventViewModel";
|
||||
import { ElementCallEventType } from "../call-types";
|
||||
|
||||
// Subset of EventTile's IProps plus some mixins
|
||||
|
||||
@@ -31,7 +31,7 @@ import getExportCSS from "./exportCSS";
|
||||
import { textForEvent } from "../../TextForEvent";
|
||||
import { haveRendererForEvent } from "../../events/EventTileFactory";
|
||||
import { SDKContext, SdkContextClass } from "../../contexts/SDKContext.ts";
|
||||
import { DateSeparatorViewModel } from "../../viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
|
||||
import exportJS from "!!raw-loader!./exportJS";
|
||||
|
||||
|
||||
@@ -15,19 +15,19 @@ import React from "react";
|
||||
import { Direction, ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { formatFullDateNoDay, formatFullDateNoTime, getDaysArray } from "../../DateUtils";
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import dispatcher from "../../dispatcher/dispatcher";
|
||||
import { Action } from "../../dispatcher/actions";
|
||||
import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { _t, getUserLanguage } from "../../languageHandler";
|
||||
import Modal from "../../Modal";
|
||||
import SettingsStore from "../../settings/SettingsStore";
|
||||
import { UIFeature } from "../../settings/UIFeature";
|
||||
import ErrorDialog from "../../components/views/dialogs/ErrorDialog";
|
||||
import BugReportDialog from "../../components/views/dialogs/BugReportDialog";
|
||||
import AccessibleButton from "../../components/views/elements/AccessibleButton";
|
||||
import { SdkContextClass } from "../../contexts/SDKContext";
|
||||
import { formatFullDateNoDay, formatFullDateNoTime, getDaysArray } from "../../../DateUtils";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import dispatcher from "../../../dispatcher/dispatcher";
|
||||
import { Action } from "../../../dispatcher/actions";
|
||||
import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { _t, getUserLanguage } from "../../../languageHandler";
|
||||
import Modal from "../../../Modal";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import { UIFeature } from "../../../settings/UIFeature";
|
||||
import ErrorDialog from "../../../components/views/dialogs/ErrorDialog";
|
||||
import BugReportDialog from "../../../components/views/dialogs/BugReportDialog";
|
||||
import AccessibleButton from "../../../components/views/elements/AccessibleButton";
|
||||
import { SdkContextClass } from "../../../contexts/SDKContext";
|
||||
|
||||
export interface DateSeparatorViewModelProps {
|
||||
/**
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
} from "@element-hq/web-shared-components";
|
||||
import { type MouseEvent } from "react";
|
||||
|
||||
import { _t } from "../../languageHandler";
|
||||
import { getUserNameColorClass } from "../../utils/FormattingUtils";
|
||||
import UserIdentifier from "../../customisations/UserIdentifier";
|
||||
import { _t } from "../../../../languageHandler";
|
||||
import { getUserNameColorClass } from "../../../../utils/FormattingUtils";
|
||||
import UserIdentifier from "../../../../customisations/UserIdentifier";
|
||||
|
||||
/**
|
||||
* Information about a member for disambiguation purposes.
|
||||
@@ -15,11 +15,11 @@ import {
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import type { RoomEncryptionEventContent } from "matrix-js-sdk/src/types";
|
||||
import DMRoomMap from "../../utils/DMRoomMap";
|
||||
import { MEGOLM_ENCRYPTION_ALGORITHM } from "../../utils/crypto";
|
||||
import { isLocalRoom } from "../../utils/localRoom/isLocalRoom";
|
||||
import { isRoomEncrypted } from "../../hooks/useIsEncrypted";
|
||||
import { objectHasDiff } from "../../utils/objects";
|
||||
import DMRoomMap from "../../../../utils/DMRoomMap";
|
||||
import { MEGOLM_ENCRYPTION_ALGORITHM } from "../../../../utils/crypto";
|
||||
import { isLocalRoom } from "../../../../utils/localRoom/isLocalRoom";
|
||||
import { isRoomEncrypted } from "../../../../hooks/useIsEncrypted";
|
||||
import { objectHasDiff } from "../../../../utils/objects";
|
||||
|
||||
export interface EncryptionEventViewModelProps {
|
||||
/** Caller-provided client. */
|
||||
@@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details.
|
||||
import { MatrixEventEvent } from "matrix-js-sdk/src/matrix";
|
||||
import { type TextualEventViewSnapshot, BaseViewModel } from "@element-hq/web-shared-components";
|
||||
|
||||
import { type EventTileTypeProps } from "../../events/EventTileFactory";
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import { textForEvent } from "../../TextForEvent";
|
||||
import { type EventTileTypeProps } from "../../../../events/EventTileFactory";
|
||||
import { MatrixClientPeg } from "../../../../MatrixClientPeg";
|
||||
import { textForEvent } from "../../../../TextForEvent";
|
||||
|
||||
export class TextualEventViewModel extends BaseViewModel<TextualEventViewSnapshot, EventTileTypeProps> {
|
||||
public constructor(props: EventTileTypeProps) {
|
||||
@@ -14,10 +14,10 @@ import {
|
||||
type AudioPlayerViewModel as AudioPlayerViewModelInterface,
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import { type Playback } from "../../audio/Playback";
|
||||
import { UPDATE_EVENT } from "../../stores/AsyncStore";
|
||||
import { getKeyBindingsManager } from "../../KeyBindingsManager";
|
||||
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
|
||||
import { type Playback } from "../../../../../audio/Playback";
|
||||
import { UPDATE_EVENT } from "../../../../../stores/AsyncStore";
|
||||
import { getKeyBindingsManager } from "../../../../../KeyBindingsManager";
|
||||
import { KeyBindingAction } from "../../../../../accessibility/KeyboardShortcuts";
|
||||
|
||||
/**
|
||||
* The number of seconds to skip when the user presses the left or right arrow keys.
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
type ReactionsRowButtonTooltipViewModel as ReactionsRowButtonTooltipViewModelInterface,
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import { _t } from "../../languageHandler";
|
||||
import { formatList } from "../../utils/FormattingUtils";
|
||||
import { unicodeToShortcode } from "../../HtmlUtils";
|
||||
import { _t } from "../../../../../languageHandler";
|
||||
import { formatList } from "../../../../../utils/FormattingUtils";
|
||||
import { unicodeToShortcode } from "../../../../../HtmlUtils";
|
||||
import { REACTION_SHORTCODE_KEY } from "./reactionShortcode";
|
||||
|
||||
export interface ReactionsRowButtonTooltipViewModelProps {
|
||||
@@ -12,10 +12,10 @@ import {
|
||||
type ReactionsRowButtonViewModel as ReactionsRowButtonViewModelInterface,
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import { mediaFromMxc } from "../../customisations/Media";
|
||||
import { _t } from "../../languageHandler";
|
||||
import { formatList } from "../../utils/FormattingUtils";
|
||||
import dis from "../../dispatcher/dispatcher";
|
||||
import { mediaFromMxc } from "../../../../../customisations/Media";
|
||||
import { _t } from "../../../../../languageHandler";
|
||||
import { formatList } from "../../../../../utils/FormattingUtils";
|
||||
import dis from "../../../../../dispatcher/dispatcher";
|
||||
import { ReactionsRowButtonTooltipViewModel } from "./ReactionsRowButtonTooltipViewModel";
|
||||
import { REACTION_SHORTCODE_KEY } from "./reactionShortcode";
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
type ReactionsRowViewModel as ReactionsRowViewModelInterface,
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import { _t } from "../../languageHandler";
|
||||
import { _t } from "../../../../../languageHandler";
|
||||
|
||||
export const MAX_ITEMS_WHEN_LIMITED = 8;
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
type MessageTimestampViewModel as MessageTimestampViewModelInterface,
|
||||
} from "@element-hq/web-shared-components";
|
||||
|
||||
import { formatFullDate, formatTime, formatFullTime, formatRelativeTime } from "../../DateUtils";
|
||||
import { objectHasDiff } from "../../utils/objects";
|
||||
import { formatFullDate, formatTime, formatFullTime, formatRelativeTime } from "../../../../../DateUtils";
|
||||
import { objectHasDiff } from "../../../../../utils/objects";
|
||||
|
||||
export interface MessageTimestampViewModelProps {
|
||||
/**
|
||||
@@ -9,7 +9,7 @@ import { type ChangeEvent, type KeyboardEvent as ReactKeyboardEvent } from "reac
|
||||
import { waitFor } from "@testing-library/dom";
|
||||
|
||||
import { type Playback, PlaybackState } from "../../../src/audio/Playback";
|
||||
import { AudioPlayerViewModel } from "../../../src/viewmodels/audio/AudioPlayerViewModel";
|
||||
import { AudioPlayerViewModel } from "../../../src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel";
|
||||
import { MockedPlayback } from "../../unit-tests/audio/MockedPlayback";
|
||||
|
||||
describe("AudioPlayerViewModel", () => {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { RoomStateEvent, type MatrixClient, type MatrixEvent, type Room } from "
|
||||
import { EncryptionEventState } from "@element-hq/web-shared-components";
|
||||
|
||||
import type { RoomEncryptionEventContent } from "matrix-js-sdk/src/types";
|
||||
import { EncryptionEventViewModel } from "../../../src/viewmodels/event-tiles/EncryptionEventViewModel";
|
||||
import { EncryptionEventViewModel } from "../../../src/viewmodels/room/timeline/event-tile/EncryptionEventViewModel";
|
||||
import { LocalRoom } from "../../../src/models/LocalRoom";
|
||||
import DMRoomMap from "../../../src/utils/DMRoomMap";
|
||||
import { mkEvent, stubClient } from "../../test-utils";
|
||||
|
||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
|
||||
import { MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { TextualEventViewModel } from "../../../src/viewmodels/event-tiles/TextualEventViewModel";
|
||||
import { TextualEventViewModel } from "../../../src/viewmodels/room/timeline/event-tile/TextualEventViewModel";
|
||||
import { stubClient } from "../../test-utils";
|
||||
|
||||
jest.mock("../../../src/TextForEvent.tsx", () => ({
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { DecryptionFailureCode } from "matrix-js-sdk/src/crypto-api";
|
||||
import { DecryptionFailureReason } from "@element-hq/web-shared-components";
|
||||
|
||||
import { DecryptionFailureBodyViewModel } from "../../../src/viewmodels/message-body/DecryptionFailureBodyViewModel";
|
||||
import { DecryptionFailureBodyViewModel } from "../../../src/viewmodels/room/timeline/event-tile/body/DecryptionFailureBodyViewModel";
|
||||
|
||||
describe("DecryptionFailureBodyViewModel", () => {
|
||||
it("should return the snapshot", () => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import * as DateUtils from "../../../src/DateUtils";
|
||||
import { MessageTimestampViewModel } from "../../../src/viewmodels/message-body/MessageTimestampViewModel";
|
||||
import { MessageTimestampViewModel } from "../../../src/viewmodels/room/timeline/event-tile/timestamp/MessageTimestampViewModel";
|
||||
|
||||
jest.mock("../../../src/settings/SettingsStore");
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { type MatrixClient, type MatrixEvent, type Room, type RoomMember } from
|
||||
import {
|
||||
ReactionsRowButtonTooltipViewModel,
|
||||
type ReactionsRowButtonTooltipViewModelProps,
|
||||
} from "../../../src/viewmodels/message-body/ReactionsRowButtonTooltipViewModel";
|
||||
} from "../../../src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonTooltipViewModel";
|
||||
import { stubClient, mkStubRoom, mkEvent } from "../../test-utils";
|
||||
import { unicodeToShortcode } from "../../../src/HtmlUtils";
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import { EventType, type MatrixClient, type MatrixEvent, RelationType, type Room
|
||||
import {
|
||||
ReactionsRowButtonViewModel,
|
||||
type ReactionsRowButtonViewModelProps,
|
||||
} from "../../../src/viewmodels/message-body/ReactionsRowButtonViewModel";
|
||||
import { type ReactionsRowButtonTooltipViewModel } from "../../../src/viewmodels/message-body/ReactionsRowButtonTooltipViewModel";
|
||||
} from "../../../src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel";
|
||||
import { type ReactionsRowButtonTooltipViewModel } from "../../../src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonTooltipViewModel";
|
||||
import { createTestClient, mkEvent, mkStubRoom } from "../../test-utils";
|
||||
import dis from "../../../src/dispatcher/dispatcher";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { type MouseEvent } from "react";
|
||||
|
||||
import { ReactionsRowViewModel } from "../../../src/viewmodels/message-body/ReactionsRowViewModel";
|
||||
import { ReactionsRowViewModel } from "../../../src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowViewModel";
|
||||
|
||||
describe("ReactionsRowViewModel", () => {
|
||||
const createVm = (
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { DisambiguatedProfileViewModel } from "../../../src/viewmodels/profile/DisambiguatedProfileViewModel";
|
||||
import { DisambiguatedProfileViewModel } from "../../../src/viewmodels/room/timeline/event-tile/DisambiguatedProfileViewModel";
|
||||
|
||||
describe("DisambiguatedProfileViewModel", () => {
|
||||
const member = {
|
||||
|
||||
@@ -17,7 +17,7 @@ import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
||||
import SettingsStore from "../../../src/settings/SettingsStore";
|
||||
import { UIFeature } from "../../../src/settings/UIFeature";
|
||||
import { SdkContextClass } from "../../../src/contexts/SDKContext";
|
||||
import { DateSeparatorViewModel } from "../../../src/viewmodels/timeline/DateSeparatorViewModel";
|
||||
import { DateSeparatorViewModel } from "../../../src/viewmodels/room/timeline/DateSeparatorViewModel";
|
||||
import { flushPromisesWithFakeTimers } from "../../test-utils";
|
||||
|
||||
jest.mock("../../../src/settings/SettingsStore");
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@@ -6,34 +6,35 @@
|
||||
*/
|
||||
|
||||
// Components
|
||||
export * from "./audio/AudioPlayerView";
|
||||
export * from "./audio/Clock";
|
||||
export * from "./audio/PlayPauseButton";
|
||||
export * from "./audio/SeekBar";
|
||||
export * from "./core/avatar/AvatarWithDetails";
|
||||
export * from "./composer/Banner";
|
||||
export * from "./crypto/SasEmoji";
|
||||
export * from "./event-tiles/EncryptionEventView";
|
||||
export * from "./event-tiles/EventTileBubble";
|
||||
export * from "./event-tiles/TextualEventView";
|
||||
export * from "./event-tiles/UrlPreviewGroupView";
|
||||
export * from "./message-body/EventContentBody";
|
||||
export * from "./message-body/MediaBody";
|
||||
export * from "./message-body/MessageTimestampView";
|
||||
export * from "./message-body/DecryptionFailureBodyView";
|
||||
export * from "./message-body/RedactedBodyView";
|
||||
export * from "./message-body/FileBodyView";
|
||||
export * from "./message-body/PinnedMessageBadge";
|
||||
export * from "./message-body/ReactionsRowButtonTooltip";
|
||||
export * from "./message-body/ReactionsRowButton";
|
||||
export * from "./message-body/ReactionsRow";
|
||||
export * from "./message-body/TimelineSeparator/";
|
||||
export * from "./core/pill-input/Pill";
|
||||
export * from "./core/pill-input/PillInput";
|
||||
export * from "./room/RoomStatusBar";
|
||||
export * from "./room/WidgetPip";
|
||||
export * from "./profile/DisambiguatedProfile";
|
||||
export * from "./room/HistoryVisibilityBadge";
|
||||
export * from "./room/timeline/DateSeparatorView";
|
||||
export * from "./room/timeline/TimelineSeparator";
|
||||
export * from "./room/timeline/event-tile/EventTileView/DisambiguatedProfile";
|
||||
export * from "./room/timeline/event-tile/EventTileView/EncryptionEventView";
|
||||
export * from "./room/timeline/event-tile/EventTileView/EventTileBubble";
|
||||
export * from "./room/timeline/event-tile/EventTileView/PinnedMessageBadge";
|
||||
export * from "./room/timeline/event-tile/EventTileView/TextualEventView";
|
||||
export * from "./room/timeline/event-tile/body/AudioPlayerView";
|
||||
export * from "./room/timeline/event-tile/body/DecryptionFailureBodyView";
|
||||
export * from "./room/timeline/event-tile/body/MediaBody";
|
||||
export * from "./room/timeline/event-tile/reactions/ReactionsRow";
|
||||
export * from "./room/timeline/event-tile/reactions/ReactionsRowButton";
|
||||
export * from "./room/timeline/event-tile/reactions/ReactionsRowButtonTooltip";
|
||||
export * from "./room/timeline/event-tile/timestamp/MessageTimestampView";
|
||||
export * from "./core/rich-list/RichItem";
|
||||
export * from "./core/rich-list/RichList";
|
||||
export * from "./room-list/RoomListHeaderView";
|
||||
@@ -44,7 +45,6 @@ export * from "./room-list/RoomListItemView";
|
||||
export * from "./room-list/RoomListItemAccessibilityWrapper";
|
||||
export * from "./room-list/RoomListPrimaryFilters";
|
||||
export * from "./room-list/VirtualizedRoomListView";
|
||||
export * from "./timeline/DateSeparatorView/";
|
||||
export * from "./core/utils/Box";
|
||||
export * from "./core/utils/Flex";
|
||||
export * from "./core/utils/LinkedText";
|
||||
|
||||
@@ -19,7 +19,7 @@ import styles from "./FileBodyView.module.css";
|
||||
import { type ViewModel } from "../../core/viewmodel/ViewModel";
|
||||
import { useViewModel } from "../../core/viewmodel/useViewModel";
|
||||
import { useI18n } from "../../core/i18n/i18nContext";
|
||||
import { MediaBody } from "../MediaBody";
|
||||
import { MediaBody } from "../../room/timeline/event-tile/body/MediaBody";
|
||||
|
||||
/**
|
||||
* Which visual state to render for the component.
|
||||
|
||||
@@ -9,8 +9,8 @@ import React from "react";
|
||||
import { Tooltip } from "@vector-im/compound-web";
|
||||
import ChevronDownIcon from "@vector-im/compound-design-tokens/assets/web/icons/chevron-down";
|
||||
|
||||
import { Flex } from "../../core/utils/Flex";
|
||||
import { useI18n } from "../../core/i18n/i18nContext";
|
||||
import { Flex } from "../../../core/utils/Flex";
|
||||
import { useI18n } from "../../../core/i18n/i18nContext";
|
||||
|
||||
/** Props for DateSeparatorButton. */
|
||||
export interface DateSeparatorButtonProps {
|
||||
@@ -9,8 +9,8 @@ import React, { type JSX, type PropsWithChildren, useRef } from "react";
|
||||
import { Menu, MenuItem, Separator } from "@vector-im/compound-web";
|
||||
import { capitalize } from "lodash";
|
||||
|
||||
import { useI18n } from "../../core/i18n/i18nContext";
|
||||
import { humanizeRelativeTime } from "../../core/utils/humanize";
|
||||
import { useI18n } from "../../../core/i18n/i18nContext";
|
||||
import { humanizeRelativeTime } from "../../../core/utils/humanize";
|
||||
import { type DateSeparatorViewModel } from "./DateSeparatorView";
|
||||
import { DateSeparatorDatePickerView } from "./DateSeparatorDatePickerView";
|
||||
import styles from "./DateSeparatorContextMenuView.module.css";
|
||||
@@ -8,9 +8,9 @@
|
||||
import React, { type JSX, useId, useRef, useState } from "react";
|
||||
import { Root, Submit, Field, TextControl, MenuItem } from "@vector-im/compound-web";
|
||||
|
||||
import { formatDateForInput } from "../../core/utils/DateUtils";
|
||||
import { useI18n } from "../../core/i18n/i18nContext";
|
||||
import { useViewModel } from "../../core/viewmodel";
|
||||
import { formatDateForInput } from "../../../core/utils/DateUtils";
|
||||
import { useI18n } from "../../../core/i18n/i18nContext";
|
||||
import { useViewModel } from "../../../core/viewmodel";
|
||||
import { type DateSeparatorViewModel } from "./DateSeparatorView";
|
||||
import styles from "./DateSeparatorDatePickerView.module.css";
|
||||
|
||||