Add options to hide header and composer of room view for the module api (#31095)
* feat: add props to hide header in `RoomView` * feat: add props to hide composer in `RoomView` * feat: pass `RoomViewProps` to room view in `renderRoomView` * refactor: add doc and use existing types * test: add tests for new room view props
This commit is contained in:
@@ -165,6 +165,16 @@ interface IRoomProps extends RoomViewProps {
|
|||||||
* Omitting this will mean that RoomView renders for the room held in SDKContext.RoomViewStore.
|
* Omitting this will mean that RoomView renders for the room held in SDKContext.RoomViewStore.
|
||||||
*/
|
*/
|
||||||
roomId?: string;
|
roomId?: string;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If true, hide the header
|
||||||
|
*/
|
||||||
|
hideHeader?: boolean;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If true, hide the composer
|
||||||
|
*/
|
||||||
|
hideComposer?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { MainSplitContentType };
|
export { MainSplitContentType };
|
||||||
@@ -2455,6 +2465,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
|
|
||||||
let messageComposer;
|
let messageComposer;
|
||||||
const showComposer =
|
const showComposer =
|
||||||
|
!this.props.hideComposer &&
|
||||||
!isRoomEncryptionLoading &&
|
!isRoomEncryptionLoading &&
|
||||||
// joined and not showing search results
|
// joined and not showing search results
|
||||||
myMembership === KnownMembership.Join &&
|
myMembership === KnownMembership.Join &&
|
||||||
@@ -2665,10 +2676,12 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
ref={this.roomViewBody}
|
ref={this.roomViewBody}
|
||||||
data-layout={this.state.layout}
|
data-layout={this.state.layout}
|
||||||
>
|
>
|
||||||
<RoomHeader
|
{!this.props.hideHeader && (
|
||||||
room={this.state.room}
|
<RoomHeader
|
||||||
additionalButtons={this.state.viewRoomOpts.buttons}
|
room={this.state.room}
|
||||||
/>
|
additionalButtons={this.state.viewRoomOpts.buttons}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{mainSplitBody}
|
{mainSplitBody}
|
||||||
</div>
|
</div>
|
||||||
</MainSplit>
|
</MainSplit>
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import { MatrixClientPeg } from "../MatrixClientPeg";
|
|||||||
import type { Room } from "matrix-js-sdk/src/matrix";
|
import type { Room } from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
interface RoomViewPropsWithRoomId extends RoomViewProps {
|
interface RoomViewPropsWithRoomId extends RoomViewProps {
|
||||||
|
/**
|
||||||
|
* The ID of the room to display
|
||||||
|
*/
|
||||||
roomId?: string;
|
roomId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,9 +29,8 @@ interface Components {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ElementWebBuiltinsApi implements BuiltinsApi {
|
export class ElementWebBuiltinsApi implements BuiltinsApi {
|
||||||
private _roomView?: React.ComponentType<RoomViewPropsWithRoomId>;
|
private _roomView?: Components["roomView"];
|
||||||
private _roomAvatar?: React.ComponentType<RoomAvatarProps>;
|
private _roomAvatar?: Components["roomAvatar"];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the components used by the API.
|
* Sets the components used by the API.
|
||||||
*
|
*
|
||||||
@@ -59,9 +61,9 @@ export class ElementWebBuiltinsApi implements BuiltinsApi {
|
|||||||
return this._roomAvatar;
|
return this._roomAvatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderRoomView(roomId: string): React.ReactNode {
|
public renderRoomView(roomId: string, props?: RoomViewProps): React.ReactNode {
|
||||||
const Component = this.getRoomViewComponent();
|
const Component = this.getRoomViewComponent();
|
||||||
return <Component roomId={roomId} />;
|
return <Component roomId={roomId} {...props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderRoomAvatar(roomId: string, size?: string): React.ReactNode {
|
public renderRoomAvatar(roomId: string, size?: string): React.ReactNode {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";
|
|||||||
import { type ViewUserPayload } from "../../../../src/dispatcher/payloads/ViewUserPayload.ts";
|
import { type ViewUserPayload } from "../../../../src/dispatcher/payloads/ViewUserPayload.ts";
|
||||||
import { CallStore } from "../../../../src/stores/CallStore.ts";
|
import { CallStore } from "../../../../src/stores/CallStore.ts";
|
||||||
import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../../src/MediaDeviceHandler.ts";
|
import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../../src/MediaDeviceHandler.ts";
|
||||||
import Modal from "../../../../src/Modal.tsx";
|
import Modal, { type ComponentProps } from "../../../../src/Modal.tsx";
|
||||||
import ErrorDialog from "../../../../src/components/views/dialogs/ErrorDialog.tsx";
|
import ErrorDialog from "../../../../src/components/views/dialogs/ErrorDialog.tsx";
|
||||||
|
|
||||||
// Used by group calls
|
// Used by group calls
|
||||||
@@ -127,7 +127,10 @@ describe("RoomView", () => {
|
|||||||
cleanup();
|
cleanup();
|
||||||
});
|
});
|
||||||
|
|
||||||
const mountRoomView = async (ref?: RefObject<RoomView | null>): Promise<RenderResult> => {
|
const mountRoomView = async (
|
||||||
|
ref?: RefObject<RoomView | null>,
|
||||||
|
props?: Partial<ComponentProps<typeof RoomView>>,
|
||||||
|
): Promise<RenderResult> => {
|
||||||
if (stores.roomViewStore.getRoomId() !== room.roomId) {
|
if (stores.roomViewStore.getRoomId() !== room.roomId) {
|
||||||
const switchedRoom = new Promise<void>((resolve) => {
|
const switchedRoom = new Promise<void>((resolve) => {
|
||||||
const subFn = () => {
|
const subFn = () => {
|
||||||
@@ -159,6 +162,7 @@ describe("RoomView", () => {
|
|||||||
threepidInvite={undefined as any}
|
threepidInvite={undefined as any}
|
||||||
forceTimeline={false}
|
forceTimeline={false}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
{...props}
|
||||||
/>
|
/>
|
||||||
</SDKContext.Provider>
|
</SDKContext.Provider>
|
||||||
</MatrixClientContext.Provider>,
|
</MatrixClientContext.Provider>,
|
||||||
@@ -250,6 +254,25 @@ describe("RoomView", () => {
|
|||||||
expect(instance.getHiddenHighlightCount()).toBe(0);
|
expect(instance.getHiddenHighlightCount()).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should hide the composer when hideComposer=true", async () => {
|
||||||
|
// Join the room
|
||||||
|
jest.spyOn(room, "getMyMembership").mockReturnValue(KnownMembership.Join);
|
||||||
|
const { asFragment } = await mountRoomView(undefined, { hideComposer: true });
|
||||||
|
|
||||||
|
expect(screen.queryByRole("textbox", { name: "Send an unencrypted message…" })).not.toBeInTheDocument();
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should hide the header when hideHeader=true", async () => {
|
||||||
|
// Join the room
|
||||||
|
jest.spyOn(room, "getMyMembership").mockReturnValue(KnownMembership.Join);
|
||||||
|
const { asFragment } = await mountRoomView(undefined, { hideHeader: true });
|
||||||
|
|
||||||
|
// Check that the room name button in the header is not rendered
|
||||||
|
expect(screen.queryByRole("button", { name: room.name })).not.toBeInTheDocument();
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
describe("invites", () => {
|
describe("invites", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const member = new RoomMember(room.roomId, cli.getSafeUserId());
|
const member = new RoomMember(room.roomId, cli.getSafeUserId());
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
|
|||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
aria-label="Messages in this room are not end-to-end encrypted"
|
aria-label="Messages in this room are not end-to-end encrypted"
|
||||||
aria-labelledby="_r_bj_"
|
aria-labelledby="_r_e1_"
|
||||||
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
|
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
|
||||||
color="var(--cpd-color-icon-info-primary)"
|
color="var(--cpd-color-icon-info-primary)"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
@@ -791,6 +791,430 @@ exports[`RoomView invites renders an invite room 1`] = `
|
|||||||
</DocumentFragment>
|
</DocumentFragment>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`RoomView should hide the composer when hideComposer=true 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView"
|
||||||
|
>
|
||||||
|
<canvas
|
||||||
|
aria-hidden="true"
|
||||||
|
height="768"
|
||||||
|
style="display: block; z-index: 999999; pointer-events: none; position: fixed; top: 0px; right: 0px;"
|
||||||
|
width="0"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="mx_MainSplit"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_body mx_MainSplit_timeline"
|
||||||
|
data-layout="group"
|
||||||
|
>
|
||||||
|
<header
|
||||||
|
class="_flex_4dswl_9 mx_RoomHeader light-panel"
|
||||||
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x); --mx-flex-wrap: nowrap;"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
aria-label="Open room settings"
|
||||||
|
aria-live="off"
|
||||||
|
class="_avatar_1qbcf_8 mx_BaseAvatar _avatar-imageless_1qbcf_52"
|
||||||
|
data-color="2"
|
||||||
|
data-testid="avatar-img"
|
||||||
|
data-type="round"
|
||||||
|
role="button"
|
||||||
|
style="--cpd-avatar-size: 40px;"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
!
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-label="Room info"
|
||||||
|
class="mx_RoomHeader_infoWrapper"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomHeader_info _box-flex_1odfs_9"
|
||||||
|
style="--mx-box-flex: 1;"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-level="1"
|
||||||
|
class="_typography_6v6n8_153 _font-body-lg-semibold_6v6n8_74 mx_RoomHeader_heading"
|
||||||
|
dir="auto"
|
||||||
|
role="heading"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="mx_RoomHeader_truncated mx_lineClamp"
|
||||||
|
>
|
||||||
|
!roomviewshouldhidethecomposerwhenhidecomposertrue:example.org
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-label="Video call"
|
||||||
|
class="_icon-button_1pz9o_8"
|
||||||
|
data-kind="primary"
|
||||||
|
role="button"
|
||||||
|
style="--cpd-icon-button-size: 32px;"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="_indicator-icon_zr2a0_17"
|
||||||
|
style="--cpd-icon-button-size: 100%;"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-labelledby="_r_0_"
|
||||||
|
fill="currentColor"
|
||||||
|
height="1em"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M6 4h10a2 2 0 0 1 2 2v4.286l3.35-2.871a1 1 0 0 1 1.65.76v7.65a1 1 0 0 1-1.65.76L18 13.715V18a2 2 0 0 1-2 2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-label="Voice call"
|
||||||
|
aria-labelledby="_r_5_"
|
||||||
|
class="_icon-button_1pz9o_8"
|
||||||
|
data-kind="primary"
|
||||||
|
role="button"
|
||||||
|
style="--cpd-icon-button-size: 32px;"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="_indicator-icon_zr2a0_17"
|
||||||
|
style="--cpd-icon-button-size: 100%;"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
height="1em"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="m20.958 16.374.039 3.527q0 .427-.33.756-.33.33-.756.33a16 16 0 0 1-6.57-1.105 16.2 16.2 0 0 1-5.563-3.663 16.1 16.1 0 0 1-3.653-5.573 16.3 16.3 0 0 1-1.115-6.56q0-.427.33-.757T4.095 3l3.528.039a1.07 1.07 0 0 1 1.085.93l.543 3.954q.039.271-.039.504a1.1 1.1 0 0 1-.271.426l-1.64 1.64q.505 1.008 1.154 1.909c.433.6 1.444 1.696 1.444 1.696s1.095 1.01 1.696 1.444q.9.65 1.909 1.153l1.64-1.64q.193-.193.426-.27t.504-.04l3.954.543q.406.059.668.359t.262.727"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-label="Threads"
|
||||||
|
aria-labelledby="_r_a_"
|
||||||
|
class="_icon-button_1pz9o_8"
|
||||||
|
data-kind="primary"
|
||||||
|
role="button"
|
||||||
|
style="--cpd-icon-button-size: 32px;"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="_indicator-icon_zr2a0_17"
|
||||||
|
style="--cpd-icon-button-size: 100%;"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
class=""
|
||||||
|
fill="currentColor"
|
||||||
|
height="1em"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M4 3h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6l-2.293 2.293c-.63.63-1.707.184-1.707-.707V5a2 2 0 0 1 2-2m3 7h10q.424 0 .712-.287A.97.97 0 0 0 18 9a.97.97 0 0 0-.288-.713A.97.97 0 0 0 17 8H7a.97.97 0 0 0-.713.287A.97.97 0 0 0 6 9q0 .424.287.713Q6.576 10 7 10m0 4h6q.424 0 .713-.287A.97.97 0 0 0 14 13a.97.97 0 0 0-.287-.713A.97.97 0 0 0 13 12H7a.97.97 0 0 0-.713.287A.97.97 0 0 0 6 13q0 .424.287.713Q6.576 14 7 14"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-label="Room info"
|
||||||
|
aria-labelledby="_r_f_"
|
||||||
|
class="_icon-button_1pz9o_8"
|
||||||
|
data-kind="primary"
|
||||||
|
role="button"
|
||||||
|
style="--cpd-icon-button-size: 32px;"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="_indicator-icon_zr2a0_17"
|
||||||
|
style="--cpd-icon-button-size: 100%;"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
class=""
|
||||||
|
fill="currentColor"
|
||||||
|
height="1em"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 17q.424 0 .713-.288A.97.97 0 0 0 13 16v-4a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 11a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 12v4q0 .424.287.712.288.288.713.288m0-8q.424 0 .713-.287A.97.97 0 0 0 13 8a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 7a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 8q0 .424.287.713Q11.576 9 12 9m0 13a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
class="_typography_6v6n8_153 _font-body-sm-medium_6v6n8_41"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-label="0 members"
|
||||||
|
aria-labelledby="_r_k_"
|
||||||
|
class="mx_AccessibleButton mx_FacePile"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="_stacked-avatars_1qbcf_102"
|
||||||
|
/>
|
||||||
|
0
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div
|
||||||
|
class="mx_AutoHideScrollbar mx_AuxPanel"
|
||||||
|
role="region"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
<main
|
||||||
|
class="mx_RoomView_timeline mx_RoomView_timeline_rr_enabled"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_AutoHideScrollbar mx_ScrollPanel mx_RoomView_messagePanel"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_messageListWrapper"
|
||||||
|
>
|
||||||
|
<ol
|
||||||
|
aria-live="polite"
|
||||||
|
class="mx_RoomView_MessageList"
|
||||||
|
style="height: 400px;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<div
|
||||||
|
aria-label="Room status bar"
|
||||||
|
class="mx_RoomView_statusArea"
|
||||||
|
role="region"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_statusAreaBox"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_statusAreaBox_line"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`RoomView should hide the header when hideHeader=true 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView"
|
||||||
|
>
|
||||||
|
<canvas
|
||||||
|
aria-hidden="true"
|
||||||
|
height="768"
|
||||||
|
style="display: block; z-index: 999999; pointer-events: none; position: fixed; top: 0px; right: 0px;"
|
||||||
|
width="0"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="mx_MainSplit"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_body mx_MainSplit_timeline"
|
||||||
|
data-layout="group"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_AutoHideScrollbar mx_AuxPanel"
|
||||||
|
role="region"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
<main
|
||||||
|
class="mx_RoomView_timeline mx_RoomView_timeline_rr_enabled"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_AutoHideScrollbar mx_ScrollPanel mx_RoomView_messagePanel"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_messageListWrapper"
|
||||||
|
>
|
||||||
|
<ol
|
||||||
|
aria-live="polite"
|
||||||
|
class="mx_RoomView_MessageList"
|
||||||
|
style="height: 400px;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<div
|
||||||
|
aria-label="Room status bar"
|
||||||
|
class="mx_RoomView_statusArea"
|
||||||
|
role="region"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_statusAreaBox"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_RoomView_statusAreaBox_line"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
aria-label="Message composer"
|
||||||
|
class="mx_MessageComposer mx_MessageComposer_e2eStatus"
|
||||||
|
role="region"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_MessageComposer_wrapper"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_MessageComposer_row"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_MessageComposer_e2eIconWrapper"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-label="Messages in this room are not end-to-end encrypted"
|
||||||
|
aria-labelledby="_r_14_"
|
||||||
|
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
|
||||||
|
color="var(--cpd-color-icon-info-primary)"
|
||||||
|
fill="currentColor"
|
||||||
|
height="12"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="12"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M6 22q-.825 0-1.412-.587A1.93 1.93 0 0 1 4 20V10q0-.825.588-1.412a2 2 0 0 1 .702-.463L1.333 4.167a1 1 0 0 1 1.414-1.414L7 7.006v-.012l13 13v.012l1.247 1.247a1 1 0 1 1-1.414 1.414l-.896-.896A1.94 1.94 0 0 1 18 22zm14-4.834V10q0-.825-.587-1.412A1.93 1.93 0 0 0 18 8h-1V6q0-2.075-1.463-3.537Q14.075 1 12 1T8.463 2.463a4.9 4.9 0 0 0-1.22 1.946L9 6.166V6q0-1.25.875-2.125A2.9 2.9 0 0 1 12 3q1.25 0 2.125.875T15 6v2h-4.166z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mx_SendMessageComposer"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mx_BasicMessageComposer"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-label="Formatting"
|
||||||
|
class="mx_MessageComposerFormatBar"
|
||||||
|
role="toolbar"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
aria-label="Bold"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconBold"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
aria-label="Italics"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconItalic"
|
||||||
|
role="button"
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
aria-label="Strikethrough"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconStrikethrough"
|
||||||
|
role="button"
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
aria-label="Code block"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconCode"
|
||||||
|
role="button"
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
aria-label="Quote"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconQuote"
|
||||||
|
role="button"
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
aria-label="Insert link"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIconInsertLink"
|
||||||
|
role="button"
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
aria-autocomplete="list"
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Send an unencrypted message…"
|
||||||
|
aria-multiline="true"
|
||||||
|
class="mx_BasicMessageComposer_input mx_BasicMessageComposer_input_shouldShowPillAvatar mx_BasicMessageComposer_inputEmpty"
|
||||||
|
contenteditable="true"
|
||||||
|
data-testid="basicmessagecomposer"
|
||||||
|
dir="auto"
|
||||||
|
role="textbox"
|
||||||
|
style="--placeholder: 'Send\\ an\\ unencrypted\\ message…';"
|
||||||
|
tabindex="0"
|
||||||
|
translate="no"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mx_MessageComposer_actions"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-label="Emoji"
|
||||||
|
class="mx_AccessibleButton mx_EmojiButton mx_MessageComposer_button mx_EmojiButton_icon"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
aria-label="Attachment"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposer_button mx_MessageComposer_upload"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
aria-label="More options"
|
||||||
|
class="mx_AccessibleButton mx_MessageComposer_button mx_MessageComposer_buttonMenu"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
multiple=""
|
||||||
|
style="display: none;"
|
||||||
|
type="file"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`RoomView should not display the timeline when the room encryption is loading 1`] = `
|
exports[`RoomView should not display the timeline when the room encryption is loading 1`] = `
|
||||||
<DocumentFragment>
|
<DocumentFragment>
|
||||||
<div
|
<div
|
||||||
@@ -863,7 +1287,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
style="--cpd-icon-button-size: 100%;"
|
style="--cpd-icon-button-size: 100%;"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
aria-labelledby="_r_2j_"
|
aria-labelledby="_r_51_"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
height="1em"
|
height="1em"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
@@ -879,7 +1303,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
<button
|
<button
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
aria-label="Voice call"
|
aria-label="Voice call"
|
||||||
aria-labelledby="_r_2o_"
|
aria-labelledby="_r_56_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -905,7 +1329,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Threads"
|
aria-label="Threads"
|
||||||
aria-labelledby="_r_2t_"
|
aria-labelledby="_r_5b_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -932,7 +1356,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
aria-labelledby="_r_32_"
|
aria-labelledby="_r_5g_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -962,7 +1386,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
aria-label="0 members"
|
aria-label="0 members"
|
||||||
aria-labelledby="_r_37_"
|
aria-labelledby="_r_5l_"
|
||||||
class="mx_AccessibleButton mx_FacePile"
|
class="mx_AccessibleButton mx_FacePile"
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -1075,7 +1499,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
style="--cpd-icon-button-size: 100%;"
|
style="--cpd-icon-button-size: 100%;"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
aria-labelledby="_r_2j_"
|
aria-labelledby="_r_51_"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
height="1em"
|
height="1em"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
@@ -1091,7 +1515,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
<button
|
<button
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
aria-label="Voice call"
|
aria-label="Voice call"
|
||||||
aria-labelledby="_r_2o_"
|
aria-labelledby="_r_56_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1117,7 +1541,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Threads"
|
aria-label="Threads"
|
||||||
aria-labelledby="_r_2t_"
|
aria-labelledby="_r_5b_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1144,7 +1568,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
aria-labelledby="_r_32_"
|
aria-labelledby="_r_5g_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1174,7 +1598,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
aria-label="0 members"
|
aria-label="0 members"
|
||||||
aria-labelledby="_r_37_"
|
aria-labelledby="_r_5l_"
|
||||||
class="mx_AccessibleButton mx_FacePile"
|
class="mx_AccessibleButton mx_FacePile"
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -1242,7 +1666,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
|||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
aria-labelledby="_r_3m_"
|
aria-labelledby="_r_64_"
|
||||||
class="mx_E2EIcon mx_E2EIcon_verified mx_MessageComposer_e2eIcon"
|
class="mx_E2EIcon mx_E2EIcon_verified mx_MessageComposer_e2eIcon"
|
||||||
data-testid="e2e-icon"
|
data-testid="e2e-icon"
|
||||||
>
|
>
|
||||||
@@ -1453,7 +1877,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Chat"
|
aria-label="Chat"
|
||||||
aria-labelledby="_r_7l_"
|
aria-labelledby="_r_a3_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1480,7 +1904,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Threads"
|
aria-label="Threads"
|
||||||
aria-labelledby="_r_7q_"
|
aria-labelledby="_r_a8_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1507,7 +1931,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
aria-labelledby="_r_7v_"
|
aria-labelledby="_r_ad_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
role="button"
|
role="button"
|
||||||
@@ -1537,7 +1961,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
aria-label="0 members"
|
aria-label="0 members"
|
||||||
aria-labelledby="_r_84_"
|
aria-labelledby="_r_ai_"
|
||||||
class="mx_AccessibleButton mx_FacePile"
|
class="mx_AccessibleButton mx_FacePile"
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -1611,7 +2035,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
aria-labelledby="_r_8d_"
|
aria-labelledby="_r_ar_"
|
||||||
class="_icon-button_1pz9o_8"
|
class="_icon-button_1pz9o_8"
|
||||||
data-kind="secondary"
|
data-kind="secondary"
|
||||||
data-testid="base-card-close-button"
|
data-testid="base-card-close-button"
|
||||||
@@ -1671,7 +2095,7 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
aria-label="Messages in this room are not end-to-end encrypted"
|
aria-label="Messages in this room are not end-to-end encrypted"
|
||||||
aria-labelledby="_r_8m_"
|
aria-labelledby="_r_b4_"
|
||||||
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
|
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
|
||||||
color="var(--cpd-color-icon-info-primary)"
|
color="var(--cpd-color-icon-info-primary)"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
|
|||||||
Reference in New Issue
Block a user