Merge branch 'release/v2' into feat/widget-integration-dx
This commit is contained in:
31 files changed
+336
-259
No files matched your search
@@ -33,14 +33,14 @@ export const normalizeBoardLayoutRoles = <
|
||||
const baseLayouts = sourceLayouts.filter((layout) => layout.role === "base");
|
||||
const mobileLayout = mobileLayouts.length === 1 ? mobileLayouts[0] : undefined;
|
||||
const baseLayout = baseLayouts.length === 1 ? baseLayouts[0] : undefined;
|
||||
const orderedLayouts =
|
||||
mobileLayout && baseLayout
|
||||
? [
|
||||
mobileLayout,
|
||||
...sourceLayouts.filter((layout) => layout.role === "custom").toSorted(compareBoardLayouts),
|
||||
baseLayout,
|
||||
]
|
||||
: sourceLayouts.toSorted(compareBoardLayouts);
|
||||
const hasProtectedLayouts = mobileLayout !== undefined && baseLayout !== undefined;
|
||||
let orderedLayouts = sourceLayouts.toSorted(compareBoardLayouts);
|
||||
if (hasProtectedLayouts) {
|
||||
orderedLayouts = [
|
||||
mobileLayout,
|
||||
...sourceLayouts.filter((layout) => layout.id !== mobileLayout.id).toSorted(compareBoardLayouts),
|
||||
];
|
||||
}
|
||||
|
||||
let previousBreakpoint = -1;
|
||||
return orderedLayouts.map((layout, index) => {
|
||||
@@ -49,7 +49,12 @@ export const normalizeBoardLayoutRoles = <
|
||||
index === 0
|
||||
? 0
|
||||
: Math.min(MAX_LAYOUT_BREAKPOINT - remainingLayouts, Math.max(previousBreakpoint + 1, layout.breakpoint));
|
||||
const role: LayoutRole = index === 0 ? "mobile" : index === orderedLayouts.length - 1 ? "base" : "custom";
|
||||
let role: LayoutRole = layout.role ?? "custom";
|
||||
if (!hasProtectedLayouts) {
|
||||
if (index === 0) role = "mobile";
|
||||
else if (index === orderedLayouts.length - 1) role = "base";
|
||||
else role = "custom";
|
||||
}
|
||||
previousBreakpoint = breakpoint;
|
||||
return { ...layout, breakpoint, role };
|
||||
});
|
||||
|
||||
@@ -66,14 +66,20 @@ export const widgetDefaultSizes: Partial<Record<WidgetKind, { width: number; hei
|
||||
clock: { width: 2, height: 1 },
|
||||
weather: { width: 2, height: 1 },
|
||||
airQuality: { width: 2, height: 1 },
|
||||
calendar: { width: 2, height: 2 },
|
||||
countdown: { width: 2, height: 1 },
|
||||
downloads: { width: 4, height: 2 },
|
||||
indexerManager: { width: 2, height: 3 },
|
||||
timer: { width: 2, height: 1 },
|
||||
bookmarks: { width: 2, height: 2 },
|
||||
uptimeKuma: { width: 2, height: 3 },
|
||||
audioStats: { width: 2, height: 2 },
|
||||
paperlessNgx: { width: 2, height: 2 },
|
||||
patchmon: { width: 2, height: 2 },
|
||||
mediaMissing: { width: 4, height: 3 },
|
||||
mediaServer: { width: 3, height: 2 },
|
||||
"mediaRequests-requestList": { width: 3, height: 2 },
|
||||
"mediaRequests-requestStats": { width: 2, height: 2 },
|
||||
mediaMissing: { width: 2, height: 2 },
|
||||
bazarr: { width: 2, height: 2 },
|
||||
assistant: { width: 10, height: 4 },
|
||||
};
|
||||
Reference in new issue
Block a user