arthub-table 0.2.4 → 0.2.5-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,23 +41,33 @@ declare class RelatedTaskViewer implements CellViewer<RelatedTaskViewerData> {
41
41
  draw(context: ViewerRenderContext, data: RelatedTaskViewerData): void;
42
42
  private drawSingleLine;
43
43
  /**
44
- * Single file-type field branch: draws label + all thumbnails proportionally scaled to fit.
45
- * Mirrors ImageViewer.drawMultipleImages scaling logic so all images stay visible whenever possible.
46
- * Drops trailing thumbnails (and shows trailing "...") only when scaled width would fall below MIN_THUMBNAIL_WIDTH.
44
+ * Single file-type field branch: draws label + thumbnails.
45
+ * Each thumbnail keeps its own aspect ratio (width = baseH × ratio, no per-image cap) and is laid out
46
+ * left-to-right; trailing thumbnails are dropped (and "..." shown) when remaining space cannot fit the
47
+ * next thumbnail at the minimum drawable width. When the total width still exceeds the available area
48
+ * after dropping, all kept thumbnails are uniformly height-scaled so they stay vertically aligned.
47
49
  */
48
50
  private drawSingleFileFieldLine;
49
51
  /**
50
- * Compute scaled-thumbnail layout for "single file-type field" mode.
51
- * Algorithm:
52
- * 1. Each thumbnail's ideal size starts from thumbHeight × aspectRatio.
53
- * Then cap by MAX_THUMBNAIL_WIDTH: if idealWidth > MAX, scale that thumbnail's
54
- * ideal height down so its width = MAX. (Keeps aspect ratio, prevents wide images
55
- * from dominating the row.)
56
- * 2. Row drawHeight = min(all per-thumbnail ideal heights). All thumbnails align to
57
- * this height; per-thumbnail width = drawHeight × aspectRatio (≤ MAX_THUMBNAIL_WIDTH).
58
- * 3. If total width + gaps > availableWidth → uniform scale-down on drawHeight.
59
- * 4. After scaling, drop trailing thumbnails whose width < MIN_THUMBNAIL_WIDTH;
60
- * retry on remaining items.
52
+ * Compute thumbnail layout for "single file-type field" mode (also reused by inline / multi-line
53
+ * thumbnail rendering).
54
+ *
55
+ * Algorithm (Plan B per-thumbnail independent width, with per-image MAX cap):
56
+ * 1. Each thumbnail's natural width = baseH × aspectRatio, then capped at MAX_THUMBNAIL_WIDTH
57
+ * so a single panorama-style image cannot dominate the row. The row height stays at baseH;
58
+ * capped wide images are rendered into a baseH × MAX box with `contain` fit so they're
59
+ * shown letterboxed instead of distorted.
60
+ * 2. Walk thumbnails left-to-right, accumulating width + THUMBNAIL_GAP. The first thumbnail
61
+ * whose remaining space cannot fit even MIN_THUMBNAIL_WIDTH is dropped together with all
62
+ * subsequent ones; the caller draws a trailing "..." indicator.
63
+ * 3. If the kept thumbnails' total width still exceeds availableWidth (e.g. one extreme image
64
+ * alone can't fit), apply a uniform height-scale so they all shrink proportionally while
65
+ * staying vertically aligned. Re-check MIN_THUMBNAIL_WIDTH after scaling and drop tail
66
+ * one-by-one if any kept item falls below the minimum (n === 1 is always accepted to keep
67
+ * at least one image visible).
68
+ *
69
+ * Compared to the previous algorithm, a single overly-wide thumbnail no longer compresses the
70
+ * entire row, so unrelated narrow thumbnails won't be silently dropped.
61
71
  */
62
72
  private computeSingleFileFieldLayout;
63
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arthub-table",
3
- "version": "0.2.4",
3
+ "version": "0.2.5-next.1",
4
4
  "description": "High-performance canvas-based table/grid component for Vue 3 with TypeScript support, featuring virtual scrolling, cell viewers, grouped rows, and nested grids.",
5
5
  "main": "dist/arthub-table.common.js",
6
6
  "module": "dist/arthub-table.umd.min.js",