release: v4.1.0

This commit is contained in:
Amruth Pillai
2024-05-05 14:55:06 +02:00
parent 68252c35fc
commit e87b05a93a
282 changed files with 11461 additions and 10713 deletions

View File

@ -2,10 +2,10 @@ import { LayoutLocator } from "./types";
// Function to find a specific item in a layout
export const findItemInLayout = (item: string, layout: string[][][]): LayoutLocator | null => {
for (let page = 0; page < layout.length; page++) {
for (let column = 0; column < layout[page].length; column++) {
for (let section = 0; section < layout[page][column].length; section++) {
if (layout[page][column][section] === item) {
for (const [page, element] of layout.entries()) {
for (const [column, element_] of element.entries()) {
for (const [section, element__] of element_.entries()) {
if (element__ === item) {
return { page, column, section };
}
}
@ -46,7 +46,7 @@ export const moveItemInLayout = (
newLayout[target.page][target.column].splice(target.section, 0, item);
return newLayout;
} catch (error) {
} catch {
return layout;
}
};