@datalayer/primer-addons 1.0.58 → 1.0.59
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.
- package/README.md +33 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/Center.d.ts +32 -0
- package/lib/components/layout/Center.js +16 -0
- package/lib/components/layout/Cluster.d.ts +32 -0
- package/lib/components/layout/Cluster.js +14 -0
- package/lib/components/layout/Grid.d.ts +40 -0
- package/lib/components/layout/Grid.js +26 -0
- package/lib/components/layout/HolyGrail.d.ts +76 -0
- package/lib/components/layout/HolyGrail.js +51 -0
- package/lib/components/layout/Masonry.d.ts +92 -0
- package/lib/components/layout/Masonry.js +109 -0
- package/lib/components/layout/Sidebar.d.ts +51 -0
- package/lib/components/layout/Sidebar.js +18 -0
- package/lib/components/layout/Split.d.ts +42 -0
- package/lib/components/layout/Split.js +23 -0
- package/lib/components/layout/Stack.d.ts +41 -0
- package/lib/components/layout/Stack.js +16 -0
- package/lib/components/layout/Switcher.d.ts +31 -0
- package/lib/components/layout/Switcher.js +22 -0
- package/lib/components/layout/index.d.ts +18 -0
- package/lib/components/layout/index.js +22 -0
- package/lib/components/layout/layoutProps.d.ts +27 -0
- package/lib/components/layout/layoutProps.js +13 -0
- package/lib/components/layout/masonryEngine.d.ts +85 -0
- package/lib/components/layout/masonryEngine.js +240 -0
- package/lib/components/layout/masonryLayout.d.ts +45 -0
- package/lib/components/layout/masonryLayout.js +113 -0
- package/package.json +1 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What lays a masonry out in the page: it reads the widths and heights,
|
|
7
|
+
* asks {@link masonryPlacement} where each item goes and writes that on the
|
|
8
|
+
* items. React renders the items and never their place — no state, no
|
|
9
|
+
* re-render per layout.
|
|
10
|
+
*
|
|
11
|
+
* ## How it stays fast
|
|
12
|
+
*
|
|
13
|
+
* - **One observer.** A single `ResizeObserver` watches the masonry (its
|
|
14
|
+
* width) and every item (its height): a picture that loads late, a font
|
|
15
|
+
* that arrives, a card that opens. It hands over the new sizes, so a
|
|
16
|
+
* change of height costs no read of the page at all.
|
|
17
|
+
* - **One layout per frame.** Whatever changed, and however many items, the
|
|
18
|
+
* observer and the window's `resize` ask for one `requestAnimationFrame`;
|
|
19
|
+
* the layout runs once in it. (Not in the observer's own callback: writing
|
|
20
|
+
* the masonry's height there is a size change of an observed element, the
|
|
21
|
+
* "ResizeObserver loop" error.)
|
|
22
|
+
* - **Reads, then writes — never mixed.** When the column width changes:
|
|
23
|
+
* write every item's width, read every height (the one reflow), write the
|
|
24
|
+
* places. When only heights changed: no read, the places only.
|
|
25
|
+
* - **Only what moved is written.** Each item's last width and place are
|
|
26
|
+
* kept; an item that stays where it was is not touched.
|
|
27
|
+
* - **O(items × columns)** arithmetic on plain numbers.
|
|
28
|
+
*
|
|
29
|
+
* The first layout, and the one after React changed the items, is done by
|
|
30
|
+
* {@link MasonryEngine.sync} in a layout effect: before the browser paints,
|
|
31
|
+
* so no item is ever seen out of place.
|
|
32
|
+
*
|
|
33
|
+
* Sizes are read as `clientWidth` and `offsetHeight`, which an ancestor's
|
|
34
|
+
* transform (a dialog scaling in) does not distort.
|
|
35
|
+
*/
|
|
36
|
+
import { masonryColumnCount, masonryColumnWidth, masonryGapPx, masonryPlacement, resolveMasonryResponsive, } from './masonryLayout';
|
|
37
|
+
/** The attribute of a masonry's items. */
|
|
38
|
+
export const MASONRY_ITEM_ATTRIBUTE = 'data-masonry-item';
|
|
39
|
+
/** The attribute of an item that takes the whole width: `full`. */
|
|
40
|
+
export const MASONRY_SPAN_ATTRIBUTE = 'data-masonry-span';
|
|
41
|
+
const px = (value) => `${Math.round(value * 100) / 100}px`;
|
|
42
|
+
const differs = (a, b) => Math.abs(a - b) > 0.01;
|
|
43
|
+
export class MasonryEngine {
|
|
44
|
+
root;
|
|
45
|
+
options;
|
|
46
|
+
records = new WeakMap();
|
|
47
|
+
observed = new Set();
|
|
48
|
+
observer;
|
|
49
|
+
frame = 0;
|
|
50
|
+
active = false;
|
|
51
|
+
width = -1;
|
|
52
|
+
height = -1;
|
|
53
|
+
constructor(root, options) {
|
|
54
|
+
this.root = root;
|
|
55
|
+
this.options = options;
|
|
56
|
+
this.observer = new ResizeObserver(entries => this.observe(entries));
|
|
57
|
+
this.observer.observe(root);
|
|
58
|
+
root.ownerDocument.defaultView?.addEventListener('resize', this.schedule, { passive: true });
|
|
59
|
+
}
|
|
60
|
+
/** The items, in the order of the page. */
|
|
61
|
+
items() {
|
|
62
|
+
const items = [];
|
|
63
|
+
for (let child = this.root.firstElementChild; child; child = child.nextElementSibling) {
|
|
64
|
+
if (child.hasAttribute(MASONRY_ITEM_ATTRIBUTE)) {
|
|
65
|
+
items.push(child);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return items;
|
|
69
|
+
}
|
|
70
|
+
/** The observer's sizes: kept, and a layout asked for if any is new. */
|
|
71
|
+
observe(entries) {
|
|
72
|
+
let dirty = false;
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
if (entry.target === this.root) {
|
|
75
|
+
// Its height is ours; only a new width matters.
|
|
76
|
+
dirty ||= this.root.clientWidth !== this.width;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const record = this.records.get(entry.target);
|
|
80
|
+
const height = entry.borderBoxSize?.[0]?.blockSize ?? entry.contentRect.height;
|
|
81
|
+
// `offsetHeight` (what `sync` reads) is this, rounded: half a pixel apart is the same height.
|
|
82
|
+
if (!record || Math.abs(record.height - height) > 0.5) {
|
|
83
|
+
if (record)
|
|
84
|
+
record.height = height;
|
|
85
|
+
dirty = true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (dirty) {
|
|
89
|
+
this.schedule();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** One layout in the next frame, however many times it is asked. */
|
|
93
|
+
schedule = () => {
|
|
94
|
+
if (!this.frame) {
|
|
95
|
+
this.frame = requestAnimationFrame(() => {
|
|
96
|
+
this.frame = 0;
|
|
97
|
+
this.layout(this.items(), false);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/** After React rendered: watch the items that are there now, and lay out at once (before the paint). */
|
|
102
|
+
sync() {
|
|
103
|
+
const items = this.items();
|
|
104
|
+
const present = new Set(items);
|
|
105
|
+
for (const item of this.observed) {
|
|
106
|
+
if (!present.has(item)) {
|
|
107
|
+
this.observer.unobserve(item);
|
|
108
|
+
this.observed.delete(item);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
for (const item of items) {
|
|
112
|
+
if (!this.observed.has(item)) {
|
|
113
|
+
this.observer.observe(item);
|
|
114
|
+
this.observed.add(item);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
this.layout(items, true);
|
|
118
|
+
}
|
|
119
|
+
layout(items, measure) {
|
|
120
|
+
const start = performance.now();
|
|
121
|
+
const root = this.root;
|
|
122
|
+
const width = root.clientWidth;
|
|
123
|
+
// Not in the page, hidden, or nothing to place: the grid of the first paint stands.
|
|
124
|
+
if (!(width > 0) || items.length === 0) {
|
|
125
|
+
this.release(items);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const options = this.options();
|
|
129
|
+
const viewport = root.ownerDocument.defaultView?.innerWidth ?? width;
|
|
130
|
+
const gap = masonryGapPx(options.gap);
|
|
131
|
+
const columns = masonryColumnCount({
|
|
132
|
+
width,
|
|
133
|
+
gap,
|
|
134
|
+
columns: resolveMasonryResponsive(options.columns, viewport),
|
|
135
|
+
minColumnWidth: options.minColumnWidth,
|
|
136
|
+
maxColumns: options.maxColumns,
|
|
137
|
+
});
|
|
138
|
+
const columnWidth = masonryColumnWidth(width, columns, gap);
|
|
139
|
+
const full = items.map(item => item.getAttribute(MASONRY_SPAN_ATTRIBUTE) === 'full');
|
|
140
|
+
// Writes: the widths.
|
|
141
|
+
if (!this.active) {
|
|
142
|
+
root.style.display = 'block';
|
|
143
|
+
this.active = true;
|
|
144
|
+
}
|
|
145
|
+
const records = new Array(items.length);
|
|
146
|
+
let moved = 0;
|
|
147
|
+
for (let index = 0; index < items.length; index++) {
|
|
148
|
+
const item = items[index];
|
|
149
|
+
let record = this.records.get(item);
|
|
150
|
+
if (!record) {
|
|
151
|
+
record = { width: -1, height: -1, left: -1, top: -1 };
|
|
152
|
+
this.records.set(item, record);
|
|
153
|
+
item.style.position = 'absolute';
|
|
154
|
+
measure = true;
|
|
155
|
+
}
|
|
156
|
+
const itemWidth = full[index] ? width : columnWidth;
|
|
157
|
+
if (differs(record.width, itemWidth)) {
|
|
158
|
+
item.style.width = px(itemWidth);
|
|
159
|
+
record.width = itemWidth;
|
|
160
|
+
measure = true;
|
|
161
|
+
moved++;
|
|
162
|
+
}
|
|
163
|
+
records[index] = record;
|
|
164
|
+
}
|
|
165
|
+
this.width = width;
|
|
166
|
+
// Reads: the heights, all at once (one reflow), and only if a width or the items changed.
|
|
167
|
+
if (measure) {
|
|
168
|
+
for (let index = 0; index < items.length; index++) {
|
|
169
|
+
records[index].height = items[index].offsetHeight;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const heights = new Float64Array(items.length);
|
|
173
|
+
for (let index = 0; index < items.length; index++) {
|
|
174
|
+
heights[index] = records[index].height;
|
|
175
|
+
}
|
|
176
|
+
const placement = masonryPlacement(heights, { columns, columnWidth, gap, isFullSpan: index => full[index] });
|
|
177
|
+
// Writes: the places that changed.
|
|
178
|
+
for (let index = 0; index < items.length; index++) {
|
|
179
|
+
const record = records[index];
|
|
180
|
+
const left = placement.left[index];
|
|
181
|
+
const top = placement.top[index];
|
|
182
|
+
const leftMoved = differs(record.left, left);
|
|
183
|
+
const topMoved = differs(record.top, top);
|
|
184
|
+
if (leftMoved) {
|
|
185
|
+
// The start edge: the right one in a right-to-left page.
|
|
186
|
+
items[index].style.insetInlineStart = px(left);
|
|
187
|
+
record.left = left;
|
|
188
|
+
}
|
|
189
|
+
if (topMoved) {
|
|
190
|
+
items[index].style.top = px(top);
|
|
191
|
+
record.top = top;
|
|
192
|
+
}
|
|
193
|
+
if (leftMoved || topMoved)
|
|
194
|
+
moved++;
|
|
195
|
+
}
|
|
196
|
+
if (differs(this.height, placement.height)) {
|
|
197
|
+
root.style.height = px(placement.height);
|
|
198
|
+
this.height = placement.height;
|
|
199
|
+
}
|
|
200
|
+
if (moved > 0) {
|
|
201
|
+
options.onLayout?.({
|
|
202
|
+
columns,
|
|
203
|
+
columnWidth,
|
|
204
|
+
height: placement.height,
|
|
205
|
+
items: items.length,
|
|
206
|
+
moved,
|
|
207
|
+
duration: performance.now() - start,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/** Back to the grid of the first paint: every style this engine wrote is taken off. */
|
|
212
|
+
release(items) {
|
|
213
|
+
if (!this.active) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.active = false;
|
|
217
|
+
this.width = -1;
|
|
218
|
+
this.height = -1;
|
|
219
|
+
this.root.style.display = '';
|
|
220
|
+
this.root.style.height = '';
|
|
221
|
+
for (const one of items) {
|
|
222
|
+
one.style.position = '';
|
|
223
|
+
one.style.width = '';
|
|
224
|
+
one.style.top = '';
|
|
225
|
+
one.style.insetInlineStart = '';
|
|
226
|
+
}
|
|
227
|
+
this.records = new WeakMap();
|
|
228
|
+
}
|
|
229
|
+
/** Stop watching, and leave the page as the first paint had it. */
|
|
230
|
+
destroy() {
|
|
231
|
+
if (this.frame) {
|
|
232
|
+
cancelAnimationFrame(this.frame);
|
|
233
|
+
this.frame = 0;
|
|
234
|
+
}
|
|
235
|
+
this.observer.disconnect();
|
|
236
|
+
this.observed.clear();
|
|
237
|
+
this.root.ownerDocument.defaultView?.removeEventListener('resize', this.schedule);
|
|
238
|
+
this.release(this.items());
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Columns closer than this in height (in pixels) are level: the leftmost takes the item. */
|
|
2
|
+
export declare const MASONRY_TIE = 1;
|
|
3
|
+
/** A value, or one per breakpoint (Primer's: 544, 768, 1012, 1280px), `null` to keep the one before. */
|
|
4
|
+
export type MasonryResponsive<T> = T | ReadonlyArray<T | null | undefined>;
|
|
5
|
+
/** The value for a screen this wide: the last one given at or under it. */
|
|
6
|
+
export declare function resolveMasonryResponsive<T>(value: MasonryResponsive<T> | undefined, viewportWidth: number): T | undefined;
|
|
7
|
+
/** A gap in pixels: an index of Primer's space scale (`3` is 16), pixels past its end. */
|
|
8
|
+
export declare function masonryGapPx(gap: number): number;
|
|
9
|
+
export interface MasonryColumnsOptions {
|
|
10
|
+
/** The width the columns share, in pixels. */
|
|
11
|
+
width: number;
|
|
12
|
+
/** The space between two columns, in pixels. */
|
|
13
|
+
gap: number;
|
|
14
|
+
/** A fixed number of columns; wins over `minColumnWidth`. */
|
|
15
|
+
columns?: number;
|
|
16
|
+
/** As many columns as fit, each at least this wide (pixels). */
|
|
17
|
+
minColumnWidth?: number;
|
|
18
|
+
/** With `minColumnWidth`: never more columns than this. */
|
|
19
|
+
maxColumns?: number;
|
|
20
|
+
}
|
|
21
|
+
/** How many columns: the fixed number, or as many of `minColumnWidth` as the width takes; one at least. */
|
|
22
|
+
export declare function masonryColumnCount({ width, gap, columns, minColumnWidth, maxColumns }: MasonryColumnsOptions): number;
|
|
23
|
+
/** The width of one of `count` columns sharing `width` with `gap` between them. */
|
|
24
|
+
export declare function masonryColumnWidth(width: number, count: number, gap: number): number;
|
|
25
|
+
export interface MasonryPlacementOptions {
|
|
26
|
+
columns: number;
|
|
27
|
+
columnWidth: number;
|
|
28
|
+
/** The space between two columns, and between two items of a column unless `rowGap` says otherwise. */
|
|
29
|
+
gap: number;
|
|
30
|
+
rowGap?: number;
|
|
31
|
+
/** Whether the item at an index takes the whole width. */
|
|
32
|
+
isFullSpan?: (index: number) => boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface MasonryPlacement {
|
|
35
|
+
/** Each item's distance from the start edge. */
|
|
36
|
+
left: number[];
|
|
37
|
+
/** Each item's distance from the top. */
|
|
38
|
+
top: number[];
|
|
39
|
+
/** Each item's column, `-1` for a full-span one. */
|
|
40
|
+
column: number[];
|
|
41
|
+
/** The height of the whole, without a gap after the last items. */
|
|
42
|
+
height: number;
|
|
43
|
+
}
|
|
44
|
+
/** Where each item goes, given its height: see the module's note. One pass, O(items × columns). */
|
|
45
|
+
export declare function masonryPlacement(heights: ArrayLike<number>, options: MasonryPlacementOptions): MasonryPlacement;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The arithmetic of a masonry: how many columns a width takes, how wide
|
|
7
|
+
* each is, and where each item goes. No DOM here, so it is tested as is.
|
|
8
|
+
*
|
|
9
|
+
* ## Placement
|
|
10
|
+
*
|
|
11
|
+
* Items are placed in their order, each at the top of the shortest column —
|
|
12
|
+
* the leftmost of those within {@link MASONRY_TIE} of the shortest, so two
|
|
13
|
+
* columns a fraction of a pixel apart read as level and the item goes to the
|
|
14
|
+
* left one. The shortest column only ever grows, so an item is never above
|
|
15
|
+
* the one before it: reading the items by their order is reading down the
|
|
16
|
+
* page, left to right where they are level — which is also the order of the
|
|
17
|
+
* elements, and so of the Tab key.
|
|
18
|
+
*
|
|
19
|
+
* A full-span item (a heading, an empty state) starts under the longest
|
|
20
|
+
* column and takes the whole width; every column goes on under it.
|
|
21
|
+
*/
|
|
22
|
+
import { BOX_BREAKPOINTS, BOX_SPACE } from '../box/boxTokens';
|
|
23
|
+
/** Columns closer than this in height (in pixels) are level: the leftmost takes the item. */
|
|
24
|
+
export const MASONRY_TIE = 1;
|
|
25
|
+
const BREAKPOINTS = BOX_BREAKPOINTS.map(value => Number.parseFloat(value));
|
|
26
|
+
/** The value for a screen this wide: the last one given at or under it. */
|
|
27
|
+
export function resolveMasonryResponsive(value, viewportWidth) {
|
|
28
|
+
if (!Array.isArray(value)) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
let resolved;
|
|
32
|
+
for (let index = 0; index < value.length && index <= BREAKPOINTS.length; index++) {
|
|
33
|
+
if (index > 0 && viewportWidth < BREAKPOINTS[index - 1]) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
const one = value[index];
|
|
37
|
+
if (one !== null && one !== undefined) {
|
|
38
|
+
resolved = one;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return resolved;
|
|
42
|
+
}
|
|
43
|
+
/** A gap in pixels: an index of Primer's space scale (`3` is 16), pixels past its end. */
|
|
44
|
+
export function masonryGapPx(gap) {
|
|
45
|
+
if (!Number.isFinite(gap) || gap <= 0) {
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
return Number.isInteger(gap) && gap < BOX_SPACE.length ? Number.parseFloat(BOX_SPACE[gap]) : gap;
|
|
49
|
+
}
|
|
50
|
+
/** How many columns: the fixed number, or as many of `minColumnWidth` as the width takes; one at least. */
|
|
51
|
+
export function masonryColumnCount({ width, gap, columns, minColumnWidth = 260, maxColumns }) {
|
|
52
|
+
if (columns !== undefined && Number.isFinite(columns)) {
|
|
53
|
+
return Math.max(1, Math.floor(columns));
|
|
54
|
+
}
|
|
55
|
+
if (!(width > 0)) {
|
|
56
|
+
return 1;
|
|
57
|
+
}
|
|
58
|
+
const min = Math.max(1, minColumnWidth);
|
|
59
|
+
let count = Math.max(1, Math.floor((width + gap) / (min + gap)));
|
|
60
|
+
if (maxColumns !== undefined && Number.isFinite(maxColumns)) {
|
|
61
|
+
count = Math.min(count, Math.max(1, Math.floor(maxColumns)));
|
|
62
|
+
}
|
|
63
|
+
return count;
|
|
64
|
+
}
|
|
65
|
+
/** The width of one of `count` columns sharing `width` with `gap` between them. */
|
|
66
|
+
export function masonryColumnWidth(width, count, gap) {
|
|
67
|
+
return Math.max(0, (width - gap * (count - 1)) / count);
|
|
68
|
+
}
|
|
69
|
+
/** Where each item goes, given its height: see the module's note. One pass, O(items × columns). */
|
|
70
|
+
export function masonryPlacement(heights, options) {
|
|
71
|
+
const columns = Math.max(1, Math.floor(options.columns));
|
|
72
|
+
const { columnWidth, gap, isFullSpan } = options;
|
|
73
|
+
const rowGap = options.rowGap ?? gap;
|
|
74
|
+
const count = heights.length;
|
|
75
|
+
const left = new Array(count);
|
|
76
|
+
const top = new Array(count);
|
|
77
|
+
const column = new Array(count);
|
|
78
|
+
// The next free top of each column.
|
|
79
|
+
const free = new Float64Array(columns);
|
|
80
|
+
let height = 0;
|
|
81
|
+
for (let index = 0; index < count; index++) {
|
|
82
|
+
const itemHeight = heights[index] > 0 ? heights[index] : 0;
|
|
83
|
+
if (isFullSpan?.(index)) {
|
|
84
|
+
let longest = 0;
|
|
85
|
+
for (let c = 0; c < columns; c++) {
|
|
86
|
+
if (free[c] > longest)
|
|
87
|
+
longest = free[c];
|
|
88
|
+
}
|
|
89
|
+
left[index] = 0;
|
|
90
|
+
top[index] = longest;
|
|
91
|
+
column[index] = -1;
|
|
92
|
+
free.fill(longest + itemHeight + rowGap);
|
|
93
|
+
height = longest + itemHeight;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
let shortest = free[0];
|
|
97
|
+
for (let c = 1; c < columns; c++) {
|
|
98
|
+
if (free[c] < shortest)
|
|
99
|
+
shortest = free[c];
|
|
100
|
+
}
|
|
101
|
+
let target = 0;
|
|
102
|
+
while (free[target] > shortest + MASONRY_TIE)
|
|
103
|
+
target++;
|
|
104
|
+
left[index] = target * (columnWidth + gap);
|
|
105
|
+
top[index] = free[target];
|
|
106
|
+
column[index] = target;
|
|
107
|
+
const bottom = free[target] + itemHeight;
|
|
108
|
+
free[target] = bottom + rowGap;
|
|
109
|
+
if (bottom > height)
|
|
110
|
+
height = bottom;
|
|
111
|
+
}
|
|
112
|
+
return { left, top, column, height };
|
|
113
|
+
}
|