chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
- i18next 23->26 + react-i18next 15->17 - prettier 2->3, reformat all files - replace @fontsource/inter with @fontsource-variable/inter 5, update import path - domhandler 5->6 (aligns with transitive deps) - lint-staged 16->17
This commit is contained in:
@@ -38,7 +38,7 @@ const hierarchyItemByOrder: SortFunc<HierarchyItem> = (a, b) =>
|
||||
const getHierarchySpaces = (
|
||||
rootSpaceId: string,
|
||||
getRoom: GetRoomCallback,
|
||||
spaceRooms: Set<string>
|
||||
spaceRooms: Set<string>,
|
||||
): HierarchyItemSpace[] => {
|
||||
const rootSpaceItem: HierarchyItemSpace = {
|
||||
roomId: rootSpaceId,
|
||||
@@ -97,7 +97,7 @@ const getSpaceHierarchy = (
|
||||
rootSpaceId: string,
|
||||
spaceRooms: Set<string>,
|
||||
getRoom: (roomId: string) => Room | undefined,
|
||||
closedCategory: (spaceId: string) => boolean
|
||||
closedCategory: (spaceId: string) => boolean,
|
||||
): SpaceHierarchy[] => {
|
||||
const spaceItems: HierarchyItemSpace[] = getHierarchySpaces(rootSpaceId, getRoom, spaceRooms);
|
||||
|
||||
@@ -138,13 +138,13 @@ export const useSpaceHierarchy = (
|
||||
spaceId: string,
|
||||
spaceRooms: Set<string>,
|
||||
getRoom: (roomId: string) => Room | undefined,
|
||||
closedCategory: (spaceId: string) => boolean
|
||||
closedCategory: (spaceId: string) => boolean,
|
||||
): SpaceHierarchy[] => {
|
||||
const mx = useMatrixClient();
|
||||
const roomToParents = useAtomValue(roomToParentsAtom);
|
||||
|
||||
const [hierarchyAtom] = useState(() =>
|
||||
atom(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory))
|
||||
atom(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory)),
|
||||
);
|
||||
const [hierarchy, setHierarchy] = useAtom(hierarchyAtom);
|
||||
|
||||
@@ -164,8 +164,8 @@ export const useSpaceHierarchy = (
|
||||
setHierarchy(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory));
|
||||
}
|
||||
},
|
||||
[spaceId, roomToParents, setHierarchy, spaceRooms, getRoom, closedCategory]
|
||||
)
|
||||
[spaceId, roomToParents, setHierarchy, spaceRooms, getRoom, closedCategory],
|
||||
),
|
||||
);
|
||||
|
||||
return hierarchy;
|
||||
@@ -175,7 +175,7 @@ const getSpaceJoinedHierarchy = (
|
||||
rootSpaceId: string,
|
||||
getRoom: GetRoomCallback,
|
||||
excludeRoom: (parentId: string, roomId: string) => boolean,
|
||||
sortRoomItems: (parentId: string, items: HierarchyItem[]) => HierarchyItem[]
|
||||
sortRoomItems: (parentId: string, items: HierarchyItem[]) => HierarchyItem[],
|
||||
): HierarchyItem[] => {
|
||||
const spaceItems: HierarchyItemSpace[] = getHierarchySpaces(rootSpaceId, getRoom, new Set());
|
||||
|
||||
@@ -221,7 +221,7 @@ export const useSpaceJoinedHierarchy = (
|
||||
spaceId: string,
|
||||
getRoom: GetRoomCallback,
|
||||
excludeRoom: (parentId: string, roomId: string) => boolean,
|
||||
sortByActivity: (spaceId: string) => boolean
|
||||
sortByActivity: (spaceId: string) => boolean,
|
||||
): HierarchyItem[] => {
|
||||
const mx = useMatrixClient();
|
||||
const roomToParents = useAtomValue(roomToParentsAtom);
|
||||
@@ -235,11 +235,11 @@ export const useSpaceJoinedHierarchy = (
|
||||
items.sort(hierarchyItemTs).sort(hierarchyItemByOrder);
|
||||
return items;
|
||||
},
|
||||
[mx, sortByActivity]
|
||||
[mx, sortByActivity],
|
||||
);
|
||||
|
||||
const [hierarchyAtom] = useState(() =>
|
||||
atom(getSpaceJoinedHierarchy(spaceId, getRoom, excludeRoom, sortRoomItems))
|
||||
atom(getSpaceJoinedHierarchy(spaceId, getRoom, excludeRoom, sortRoomItems)),
|
||||
);
|
||||
const [hierarchy, setHierarchy] = useAtom(hierarchyAtom);
|
||||
|
||||
@@ -259,8 +259,8 @@ export const useSpaceJoinedHierarchy = (
|
||||
setHierarchy(getSpaceJoinedHierarchy(spaceId, getRoom, excludeRoom, sortRoomItems));
|
||||
}
|
||||
},
|
||||
[spaceId, roomToParents, setHierarchy, getRoom, excludeRoom, sortRoomItems]
|
||||
)
|
||||
[spaceId, roomToParents, setHierarchy, getRoom, excludeRoom, sortRoomItems],
|
||||
),
|
||||
);
|
||||
|
||||
return hierarchy;
|
||||
@@ -276,7 +276,7 @@ export type FetchSpaceHierarchyLevelData = {
|
||||
};
|
||||
export const useFetchSpaceHierarchyLevel = (
|
||||
roomId: string,
|
||||
enable: boolean
|
||||
enable: boolean,
|
||||
): FetchSpaceHierarchyLevelData => {
|
||||
const mx = useMatrixClient();
|
||||
const pageNoRef = useRef(0);
|
||||
@@ -287,7 +287,7 @@ export const useFetchSpaceHierarchyLevel = (
|
||||
string | undefined
|
||||
> = useCallback(
|
||||
({ pageParam }) => mx.getRoomHierarchy(roomId, PER_PAGE_COUNT, 1, false, pageParam),
|
||||
[roomId, mx]
|
||||
[roomId, mx],
|
||||
);
|
||||
|
||||
const queryResponse = useInfiniteQuery({
|
||||
|
||||
Reference in New Issue
Block a user