2021-07-16 10:57:14 -06:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2021-07-16 10:57:14 -06:00
|
|
|
Copyright 2021 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2021-07-16 10:57:14 -06:00
|
|
|
*/
|
|
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type LegacyRef } from "react";
|
|
|
|
|
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
|
2021-12-09 09:10:23 +00:00
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import type React from "react";
|
|
|
|
|
import { type MediaEventHelper } from "../../../utils/MediaEventHelper";
|
|
|
|
|
import type EditorStateTransfer from "../../../utils/EditorStateTransfer";
|
|
|
|
|
import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks";
|
|
|
|
|
import { type GetRelationsForEvent } from "../rooms/EventTile";
|
2021-07-16 10:57:14 -06:00
|
|
|
|
|
|
|
|
export interface IBodyProps {
|
|
|
|
|
mxEvent: MatrixEvent;
|
|
|
|
|
|
|
|
|
|
/* a list of words to highlight */
|
2022-07-12 07:27:45 +01:00
|
|
|
highlights?: string[];
|
2021-07-16 10:57:14 -06:00
|
|
|
|
|
|
|
|
/* link URL for the highlights */
|
2022-07-12 07:27:45 +01:00
|
|
|
highlightLink?: string;
|
2021-07-16 10:57:14 -06:00
|
|
|
|
|
|
|
|
/* callback called when dynamic content in events are loaded */
|
2023-05-11 09:56:56 +01:00
|
|
|
onHeightChanged?: () => void;
|
2021-07-16 10:57:14 -06:00
|
|
|
|
|
|
|
|
showUrlPreview?: boolean;
|
2021-07-21 11:35:27 +05:30
|
|
|
forExport?: boolean;
|
2021-07-16 10:57:14 -06:00
|
|
|
maxImageHeight?: number;
|
|
|
|
|
replacingEventId?: string;
|
|
|
|
|
editState?: EditorStateTransfer;
|
2023-07-07 13:37:26 +01:00
|
|
|
onMessageAllowed?: () => void; // TODO: Docs
|
2023-05-11 09:56:56 +01:00
|
|
|
permalinkCreator?: RoomPermalinkCreator;
|
2023-07-07 13:37:26 +01:00
|
|
|
mediaEventHelper?: MediaEventHelper;
|
2021-11-23 10:27:44 +00:00
|
|
|
|
2022-01-17 16:04:37 +01:00
|
|
|
/*
|
|
|
|
|
If present and `true`, the message has been marked as hidden pending moderation
|
|
|
|
|
(see MSC3531) **but** the current user can see the message nevertheless (with
|
|
|
|
|
a marker), either because they are a moderator or because they are the original
|
|
|
|
|
author of the message.
|
|
|
|
|
*/
|
|
|
|
|
isSeeingThroughMessageHiddenForModeration?: boolean;
|
|
|
|
|
|
2021-11-23 10:27:44 +00:00
|
|
|
// helper function to access relations for this event
|
2022-11-21 21:54:24 -06:00
|
|
|
getRelationsForEvent?: GetRelationsForEvent;
|
2022-04-11 11:16:32 +02:00
|
|
|
|
|
|
|
|
ref?: React.RefObject<any> | LegacyRef<any>;
|
2023-06-06 09:20:21 +01:00
|
|
|
|
|
|
|
|
// Set to `true` to disable interactions (e.g. video controls) and to remove controls from the tab order.
|
|
|
|
|
// This may be useful when displaying a preview of the event.
|
|
|
|
|
inhibitInteraction?: boolean;
|
2021-07-16 10:57:14 -06:00
|
|
|
}
|