refactor(sc): rename room list accessibility wrapper to room list wrapper (#33458)
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 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: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 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: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 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: 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: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
@@ -55,11 +55,11 @@ export * from "./core/rich-list/RichList";
|
|||||||
export * from "./room-list/RoomListHeaderView";
|
export * from "./room-list/RoomListHeaderView";
|
||||||
export * from "./room-list/RoomListSearchView";
|
export * from "./room-list/RoomListSearchView";
|
||||||
export * from "./room-list/RoomListView";
|
export * from "./room-list/RoomListView";
|
||||||
export * from "./room-list/VirtualizedRoomListView/RoomListItemAccessibilityWrapper/RoomListItemView";
|
export * from "./room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView";
|
||||||
export * from "./room-list/RoomListPrimaryFilters";
|
export * from "./room-list/RoomListPrimaryFilters";
|
||||||
export * from "./room-list/VirtualizedRoomListView";
|
export * from "./room-list/VirtualizedRoomListView";
|
||||||
export * from "./room-list/VirtualizedRoomListView/RoomListSectionHeaderView";
|
export * from "./room-list/VirtualizedRoomListView/RoomListSectionHeaderView";
|
||||||
export * from "./room-list/VirtualizedRoomListView/RoomListItemAccessibilityWrapper";
|
export * from "./room-list/VirtualizedRoomListView/RoomListItemWrapper";
|
||||||
export * from "./core/utils/Box";
|
export * from "./core/utils/Box";
|
||||||
export * from "./core/utils/Flex";
|
export * from "./core/utils/Flex";
|
||||||
export * from "./core/utils/LinkedText";
|
export * from "./core/utils/LinkedText";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { fn } from "storybook/test";
|
|||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { FilterId } from "../RoomListPrimaryFilters";
|
import type { FilterId } from "../RoomListPrimaryFilters";
|
||||||
import { RoomListView, type RoomListViewSnapshot, type RoomListViewActions } from "./RoomListView";
|
import { RoomListView, type RoomListViewSnapshot, type RoomListViewActions } from "./RoomListView";
|
||||||
import type { Room } from "../VirtualizedRoomListView/RoomListItemAccessibilityWrapper/RoomListItemView";
|
import type { Room } from "../VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView";
|
||||||
import { useMockedViewModel } from "../../core/viewmodel";
|
import { useMockedViewModel } from "../../core/viewmodel";
|
||||||
import { withViewDocs } from "../../../.storybook/withViewDocs";
|
import { withViewDocs } from "../../../.storybook/withViewDocs";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ import { RoomListPrimaryFilters, type FilterId } from "../RoomListPrimaryFilters
|
|||||||
import { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
import { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
||||||
import { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
import { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
||||||
import { VirtualizedRoomListView, type RoomListViewState } from "../VirtualizedRoomListView";
|
import { VirtualizedRoomListView, type RoomListViewState } from "../VirtualizedRoomListView";
|
||||||
import {
|
import { type Room, type RoomListItemViewModel } from "../VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView";
|
||||||
type Room,
|
|
||||||
type RoomListItemViewModel,
|
|
||||||
} from "../VirtualizedRoomListView/RoomListItemAccessibilityWrapper/RoomListItemView";
|
|
||||||
import { type RoomListSectionHeaderViewModel } from "../VirtualizedRoomListView/RoomListSectionHeaderView";
|
import { type RoomListSectionHeaderViewModel } from "../VirtualizedRoomListView/RoomListSectionHeaderView";
|
||||||
import { type ToastType, RoomListToast } from "./RoomListToast";
|
import { type ToastType, RoomListToast } from "./RoomListToast";
|
||||||
import styles from "./RoomListView.module.css";
|
import styles from "./RoomListView.module.css";
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ export type {
|
|||||||
export { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
export { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
||||||
export { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
export { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
||||||
export type { RoomListEmptyStateViewProps } from "./RoomListEmptyStateView";
|
export type { RoomListEmptyStateViewProps } from "./RoomListEmptyStateView";
|
||||||
export * from "../VirtualizedRoomListView/RoomListItemAccessibilityWrapper/RoomListItemView";
|
export * from "../VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView";
|
||||||
export * from "./RoomListToast";
|
export * from "./RoomListToast";
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import React from "react";
|
|||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import { RoomListItemAccessibilityWrapper } from "./RoomListItemAccessibilityWrapper";
|
import { RoomListItemWrapper } from "./RoomListItemWrapper";
|
||||||
import { createMockRoomItemViewModel, renderAvatar } from "../../story-mocks";
|
import { createMockRoomItemViewModel, renderAvatar } from "../../story-mocks";
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: "Room List/RoomListItemAccessibilityWrapper",
|
title: "Room List/RoomListItemWrapper",
|
||||||
component: RoomListItemAccessibilityWrapper,
|
component: RoomListItemWrapper,
|
||||||
tags: ["autodocs"],
|
tags: ["autodocs"],
|
||||||
args: {
|
args: {
|
||||||
roomIndex: 0,
|
roomIndex: 0,
|
||||||
@@ -35,7 +35,7 @@ const meta = {
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
} satisfies Meta<typeof RoomListItemAccessibilityWrapper>;
|
} satisfies Meta<typeof RoomListItemWrapper>;
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
@@ -10,7 +10,7 @@ import React, { memo, type JSX } from "react";
|
|||||||
import { RoomListItemView, type RoomListItemViewProps } from "./RoomListItemView";
|
import { RoomListItemView, type RoomListItemViewProps } from "./RoomListItemView";
|
||||||
import { getItemAccessibleProps } from "../../../core/VirtualizedList";
|
import { getItemAccessibleProps } from "../../../core/VirtualizedList";
|
||||||
|
|
||||||
export interface RoomListItemAccessibilityWrapperPros extends RoomListItemViewProps {
|
export interface RoomListItemWrapperProps extends RoomListItemViewProps {
|
||||||
/** Index of this room in the list */
|
/** Index of this room in the list */
|
||||||
roomIndex: number;
|
roomIndex: number;
|
||||||
/** Index of this room in its section */
|
/** Index of this room in its section */
|
||||||
@@ -27,7 +27,7 @@ export interface RoomListItemAccessibilityWrapperPros extends RoomListItemViewPr
|
|||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ``
|
* ``
|
||||||
* <RoomListItemAccessibilityWrapper
|
* <RoomListItemWrapper
|
||||||
* roomIndex={0}
|
* roomIndex={0}
|
||||||
* roomIndexInSection={0}
|
* roomIndexInSection={0}
|
||||||
* roomCount={10}
|
* roomCount={10}
|
||||||
@@ -36,13 +36,13 @@ export interface RoomListItemAccessibilityWrapperPros extends RoomListItemViewPr
|
|||||||
* />
|
* />
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const RoomListItemAccessibilityWrapper = memo(function RoomListItemAccessibilityWrapper({
|
export const RoomListItemWrapper = memo(function RoomListItemWrapper({
|
||||||
roomIndex,
|
roomIndex,
|
||||||
roomCount,
|
roomCount,
|
||||||
roomIndexInSection,
|
roomIndexInSection,
|
||||||
isInFlatList,
|
isInFlatList,
|
||||||
...rest
|
...rest
|
||||||
}: RoomListItemAccessibilityWrapperPros): JSX.Element {
|
}: RoomListItemWrapperProps): JSX.Element {
|
||||||
const itemA11yProps = isInFlatList ? getItemAccessibleProps("listbox", roomIndex, roomCount) : { role: "gridcell" };
|
const itemA11yProps = isInFlatList ? getItemAccessibleProps("listbox", roomIndex, roomCount) : { role: "gridcell" };
|
||||||
const item = <RoomListItemView {...rest} {...itemA11yProps} />;
|
const item = <RoomListItemView {...rest} {...itemA11yProps} />;
|
||||||
|
|
||||||
@@ -5,4 +5,4 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { RoomListItemAccessibilityWrapper } from "./RoomListItemAccessibilityWrapper";
|
export { RoomListItemWrapper } from "./RoomListItemWrapper";
|
||||||
@@ -9,7 +9,7 @@ import React, { type JSX } from "react";
|
|||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { Room } from "./RoomListItemAccessibilityWrapper/RoomListItemView";
|
import type { Room } from "./RoomListItemWrapper/RoomListItemView";
|
||||||
import { VirtualizedRoomListView, type RoomListViewState } from "./VirtualizedRoomListView";
|
import { VirtualizedRoomListView, type RoomListViewState } from "./VirtualizedRoomListView";
|
||||||
import type { RoomListViewSnapshot, RoomListViewActions } from "../RoomListView";
|
import type { RoomListViewSnapshot, RoomListViewActions } from "../RoomListView";
|
||||||
import { useMockedViewModel } from "../../core/viewmodel";
|
import { useMockedViewModel } from "../../core/viewmodel";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef, type JSX, type Re
|
|||||||
import { type ScrollIntoViewLocation, type VirtuosoHandle } from "react-virtuoso";
|
import { type ScrollIntoViewLocation, type VirtuosoHandle } from "react-virtuoso";
|
||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
|
|
||||||
import { type Room } from "./RoomListItemAccessibilityWrapper/RoomListItemView";
|
import { type Room } from "./RoomListItemWrapper/RoomListItemView";
|
||||||
import { useViewModel } from "../../core/viewmodel";
|
import { useViewModel } from "../../core/viewmodel";
|
||||||
import { _t } from "../../core/i18n/i18n";
|
import { _t } from "../../core/i18n/i18n";
|
||||||
import {
|
import {
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
import type { RoomListViewSnapshot, RoomListViewModel } from "../RoomListView";
|
import type { RoomListViewSnapshot, RoomListViewModel } from "../RoomListView";
|
||||||
import { GroupedVirtualizedList } from "../../core/VirtualizedList";
|
import { GroupedVirtualizedList } from "../../core/VirtualizedList";
|
||||||
import { RoomListSectionHeaderView } from "./RoomListSectionHeaderView";
|
import { RoomListSectionHeaderView } from "./RoomListSectionHeaderView";
|
||||||
import { RoomListItemAccessibilityWrapper } from "./RoomListItemAccessibilityWrapper";
|
import { RoomListItemWrapper } from "./RoomListItemWrapper";
|
||||||
import styles from "./VirtualizedRoomListView.module.css";
|
import styles from "./VirtualizedRoomListView.module.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -181,7 +181,7 @@ export function VirtualizedRoomListView({ vm, renderAvatar, onKeyDown }: Virtual
|
|||||||
const isLastItem = Boolean((isFlatList || isInLastSection) && index === roomCount - 1);
|
const isLastItem = Boolean((isFlatList || isInLastSection) && index === roomCount - 1);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RoomListItemAccessibilityWrapper
|
<RoomListItemWrapper
|
||||||
key={roomId}
|
key={roomId}
|
||||||
vm={roomItemVM}
|
vm={roomItemVM}
|
||||||
renderAvatar={renderAvatar}
|
renderAvatar={renderAvatar}
|
||||||
|
|||||||
@@ -8,4 +8,4 @@
|
|||||||
export { VirtualizedRoomListView } from "./VirtualizedRoomListView";
|
export { VirtualizedRoomListView } from "./VirtualizedRoomListView";
|
||||||
export type { VirtualizedRoomListViewProps, RoomListViewState, FilterKey } from "./VirtualizedRoomListView";
|
export type { VirtualizedRoomListViewProps, RoomListViewState, FilterKey } from "./VirtualizedRoomListView";
|
||||||
export * from "./RoomListSectionHeaderView";
|
export * from "./RoomListSectionHeaderView";
|
||||||
export * from "./RoomListItemAccessibilityWrapper";
|
export * from "./RoomListItemWrapper";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
type RoomListItemViewModel,
|
type RoomListItemViewModel,
|
||||||
type RoomListItemViewSnapshot,
|
type RoomListItemViewSnapshot,
|
||||||
RoomNotifState,
|
RoomNotifState,
|
||||||
} from "./VirtualizedRoomListView/RoomListItemAccessibilityWrapper/RoomListItemView";
|
} from "./VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView";
|
||||||
import { type RoomListSectionHeaderViewModel } from "./VirtualizedRoomListView/RoomListSectionHeaderView";
|
import { type RoomListSectionHeaderViewModel } from "./VirtualizedRoomListView/RoomListSectionHeaderView";
|
||||||
import { MockViewModel } from "../core/viewmodel";
|
import { MockViewModel } from "../core/viewmodel";
|
||||||
|
|
||||||
|
|||||||