Move shared message body views into event-tile layout (#33015)
* Move shared message body views into event-tile layout * Move shared message body visual baselines
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 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: 20 KiB After Width: | Height: | Size: 20 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: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 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: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@ -13,9 +13,9 @@ export * from "./core/avatar/AvatarWithDetails";
|
||||
export * from "./composer/Banner";
|
||||
export * from "./crypto/SasEmoji";
|
||||
export * from "./event-tiles/UrlPreviewGroupView";
|
||||
export * from "./message-body/EventContentBody";
|
||||
export * from "./message-body/RedactedBodyView";
|
||||
export * from "./message-body/FileBodyView";
|
||||
export * from "./room/timeline/event-tile/body/EventContentBodyView";
|
||||
export * from "./room/timeline/event-tile/body/RedactedBodyView";
|
||||
export * from "./room/timeline/event-tile/body/MFileBodyView";
|
||||
export * from "./room/timeline/event-tile/body/MVideoBodyView";
|
||||
export * from "./core/pill-input/Pill";
|
||||
export * from "./core/pill-input/PillInput";
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details.
|
||||
import React, { type JSX } from "react";
|
||||
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { useMockedViewModel } from "../../core/viewmodel/useMockedViewModel";
|
||||
import { useMockedViewModel } from "../../../../../core/viewmodel/useMockedViewModel";
|
||||
import { EventContentBodyView, type EventContentBodyViewSnapshot } from "./EventContentBodyView";
|
||||
import styles from "./EventContentBody.module.css";
|
||||
import { withViewDocs } from "../../../.storybook/withViewDocs";
|
||||
import { withViewDocs } from "../../../../../../.storybook/withViewDocs";
|
||||
|
||||
type EventContentBodyStoryProps = EventContentBodyViewSnapshot & {
|
||||
as: "div" | "span";
|
||||
@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details.
|
||||
import React, { type JSX, memo, type Ref } from "react";
|
||||
import parse, { type HTMLReactParserOptions } from "html-react-parser";
|
||||
|
||||
import { type ViewModel, useViewModel } from "../../core/viewmodel";
|
||||
import { applyReplacerOnString } from "../../core/utils/applyReplacerOnString";
|
||||
import { type ViewModel, useViewModel } from "../../../../../core/viewmodel";
|
||||
import { applyReplacerOnString } from "../../../../../core/utils/applyReplacerOnString";
|
||||
|
||||
type Replacer = HTMLReactParserOptions["replace"];
|
||||
type ParseFormattedBody = (formattedBody: string, replacer?: Replacer) => ReturnType<typeof parse>;
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -16,8 +16,8 @@ import {
|
||||
type FileBodyViewActions,
|
||||
type FileBodyViewSnapshot,
|
||||
} from "./FileBodyView";
|
||||
import { useMockedViewModel } from "../../core/viewmodel/useMockedViewModel";
|
||||
import { withViewDocs } from "../../../.storybook/withViewDocs";
|
||||
import { useMockedViewModel } from "../../../../../core/viewmodel/useMockedViewModel";
|
||||
import { withViewDocs } from "../../../../../../.storybook/withViewDocs";
|
||||
|
||||
type FileBodyViewProps = FileBodyViewSnapshot & FileBodyViewActions;
|
||||
|
||||
@ -11,9 +11,9 @@ import { fireEvent, render, screen } from "@test-utils";
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
|
||||
import { FileBodyView, FileBodyViewState, type FileBodyViewActions, type FileBodyViewSnapshot } from "./FileBodyView";
|
||||
import { MockViewModel } from "../../core/viewmodel/MockViewModel";
|
||||
import { I18nApi } from "../../index";
|
||||
import { I18nContext } from "../../core/i18n/i18nContext";
|
||||
import { MockViewModel } from "../../../../../core/viewmodel/MockViewModel";
|
||||
import { I18nApi } from "../../../../../index";
|
||||
import { I18nContext } from "../../../../../core/i18n/i18nContext";
|
||||
import * as stories from "./FileBodyView.stories";
|
||||
|
||||
const renderWithI18n = (ui: React.ReactElement): ReturnType<typeof render> =>
|
||||
@ -16,10 +16,10 @@ import {
|
||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
|
||||
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 "../../room/timeline/event-tile/body/MediaBody";
|
||||
import { type ViewModel } from "../../../../../core/viewmodel/ViewModel";
|
||||
import { useViewModel } from "../../../../../core/viewmodel/useViewModel";
|
||||
import { useI18n } from "../../../../../core/i18n/i18nContext";
|
||||
import { MediaBody } from "../MediaBody";
|
||||
|
||||
/**
|
||||
* Which visual state to render for the component.
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -9,8 +9,8 @@ import React, { type JSX } from "react";
|
||||
import { expect, userEvent, within } from "storybook/test";
|
||||
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { useMockedViewModel } from "../../core/viewmodel";
|
||||
import { withViewDocs } from "../../../.storybook/withViewDocs";
|
||||
import { useMockedViewModel } from "../../../../../core/viewmodel";
|
||||
import { withViewDocs } from "../../../../../../.storybook/withViewDocs";
|
||||
import { RedactedBodyView, type RedactedBodyViewSnapshot } from "./RedactedBodyView";
|
||||
|
||||
type RedactedBodyProps = RedactedBodyViewSnapshot;
|
||||
@ -11,7 +11,7 @@ import React from "react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { MockViewModel } from "../../core/viewmodel";
|
||||
import { MockViewModel } from "../../../../../core/viewmodel";
|
||||
import { RedactedBodyView, type RedactedBodyViewModel, type RedactedBodyViewSnapshot } from "./RedactedBodyView";
|
||||
import * as stories from "./RedactedBodyView.stories";
|
||||
|
||||
@ -10,8 +10,8 @@ import classNames from "classnames";
|
||||
import { DeleteIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
import { Tooltip } from "@vector-im/compound-web";
|
||||
|
||||
import { type ViewModel } from "../../core/viewmodel";
|
||||
import { useViewModel } from "../../core/viewmodel/useViewModel";
|
||||
import { type ViewModel } from "../../../../../core/viewmodel";
|
||||
import { useViewModel } from "../../../../../core/viewmodel/useViewModel";
|
||||
import styles from "./RedactedBodyView.module.css";
|
||||
|
||||
export interface RedactedBodyViewSnapshot {
|
||||