frontend lint

This commit is contained in:
2025-10-29 17:40:11 +01:00
parent 1cc0aafc1a
commit ec6e7f04f2
10 changed files with 2655 additions and 319 deletions
+1 -21
View File
@@ -17,12 +17,8 @@ import PreviewZoomOverlay from './detail/PreviewZoomOverlay';
import { getTagColorStyle } from './utils/colors';
import './DesktopWorkspace.css';
const ITEM_WIDTH = 220;
const ITEM_HEIGHT = 260;
const CANVAS_PADDING = 24;
const ROTATION_RANGE = 7;
const JITTER_X = 26;
const JITTER_Y = 32;
const DEFAULT_CANVAS_WIDTH = 1024;
const DEFAULT_CANVAS_HEIGHT = 680;
const TAG_MIME_TYPES = ['application/x-papercrate-tag', 'text/papercrate-tag'];
@@ -90,7 +86,6 @@ const DesktopPreviewCard = ({
prefetch = 3,
onNavigatorSnapshot,
shouldLoad = true,
imageSize = null,
}) => {
const navigator = useAssetNavigator({
document: doc,
@@ -230,9 +225,6 @@ const generateInitialLayout = (
}
const shelfOffset = Math.max(shelfWidth, 0);
const usableWidth = Math.max(canvasWidth - shelfOffset - padding * 2, 1);
const usableHeight = Math.max(canvasHeight - padding * 2, 1);
const spacingBuffer = Math.max(minSpacing, 0);
const placed = [];
@@ -267,7 +259,7 @@ const generateInitialLayout = (
return best;
};
entries.forEach((entry, index) => {
entries.forEach((entry) => {
const width = Number(entry.width) || 0;
const height = Number(entry.height) || 0;
if (!entry.id || width <= 0 || height <= 0) {
@@ -874,18 +866,6 @@ const DesktopWorkspace = ({
},
[resolvePreviewDimensions],
);
const polygonArea = (points) => {
let area = 0;
const count = points.length;
for (let index = 0; index < count; index += 1) {
const next = (index + 1) % count;
area += points[index].x * points[next].y;
area -= points[next].x * points[index].y;
}
return area / 2;
};
const signedDistance = (ax, ay, bx, by, px, py) => (bx - ax) * (py - ay) - (by - ay) * (px - ax);
const clipPolygonWithEdge = (subject, edgeStart, edgeEnd) => {