@jetbrains/ring-ui-built 8.0.0-beta.13 → 8.0.0-beta.15

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.
Files changed (40) hide show
  1. package/components/_helpers/table.js +1 -1
  2. package/components/auth/iframe-flow.js +0 -1
  3. package/components/auth-dialog/auth-dialog.js +0 -1
  4. package/components/auth-dialog-service/auth-dialog-service.js +0 -1
  5. package/components/collapsible-group/collapsible-group.d.ts +2 -1
  6. package/components/collapsible-group/collapsible-group.js +74 -77
  7. package/components/column-resize/column-group.js +69 -0
  8. package/components/column-resize/column-resize-drag.js +147 -0
  9. package/components/column-resize/column-resize-handle.js +86 -0
  10. package/components/column-resize/column-sizing-context.js +200 -0
  11. package/components/confirm/confirm.js +0 -1
  12. package/components/confirm-service/confirm-service.js +0 -1
  13. package/components/dialog/dialog.js +11 -2
  14. package/components/internal/column-indicator-vertical-span.js +23 -0
  15. package/components/internal/drag-auto-scroll.js +118 -0
  16. package/components/internal/reorder-handle.js +198 -210
  17. package/components/internal/table-header.js +152 -113
  18. package/components/island/content.d.ts +2 -4
  19. package/components/island/content.js +21 -21
  20. package/components/island/island.js +0 -1
  21. package/components/login-dialog/login-dialog.js +0 -1
  22. package/components/login-dialog/service.js +0 -1
  23. package/components/style.css +1 -1
  24. package/components/table/default-item-renderer.js +6 -4
  25. package/components/table/internal/column-indicator-vertical-span.d.ts +8 -0
  26. package/components/table/internal/column-resize/column-group.d.ts +8 -0
  27. package/components/table/internal/column-resize/column-resize-drag.d.ts +27 -0
  28. package/components/table/internal/column-resize/column-resize-handle.d.ts +5 -0
  29. package/components/table/internal/column-resize/column-sizing-context.d.ts +27 -0
  30. package/components/table/internal/drag-auto-scroll.d.ts +18 -0
  31. package/components/table/item-virtualization.d.ts +2 -1
  32. package/components/table/table-const.d.ts +6 -0
  33. package/components/table/table-const.js +7 -1
  34. package/components/table/table-primitives.js +2 -0
  35. package/components/table/table-props.d.ts +39 -0
  36. package/components/table/table.d.ts +8 -0
  37. package/components/table/table.js +239 -165
  38. package/components/user-agreement/service.js +0 -1
  39. package/components/user-agreement/user-agreement.js +0 -1
  40. package/package.json +1 -2
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { use, useState, useRef } from 'react';
2
+ import { use, useState, useRef, useId } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import arrowDownIcon from '@jetbrains/icons/arrow-12px-down';
5
5
  import arrowUpIcon from '@jetbrains/icons/arrow-12px-up';
@@ -13,6 +13,7 @@ import { ReorderHandle } from './reorder-handle.js';
13
13
  import { ReorderAnimationContext } from './reorder-animation-context.js';
14
14
  import { useReorderLayoutContextValue, ReorderLayoutContext } from './reorder-layout-context.js';
15
15
  import { useReorderItemLayout } from '../table/reorder-item-layout.js';
16
+ import { ColumnResizeHandle } from '../column-resize/column-resize-handle.js';
16
17
  import { s as styles } from '../_helpers/table.js';
17
18
  import { jsx, jsxs } from 'react/jsx-runtime';
18
19
  import 'util-deprecate';
@@ -23,15 +24,20 @@ import '@jetbrains/icons/drag-12px';
23
24
  import '../global/compose-refs.js';
24
25
  import 'memoize-one';
25
26
  import '../global/parse-css-duration.js';
27
+ import './drag-auto-scroll.js';
28
+ import './column-indicator-vertical-span.js';
26
29
  import '../global/schedule-with-cleanup.js';
30
+ import 'react-dom';
31
+ import '../column-resize/column-sizing-context.js';
32
+ import '../column-resize/column-resize-drag.js';
27
33
 
28
34
  function TableHeader() {
29
35
  const $ = c(30);
30
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
36
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
31
37
  for (let $i = 0; $i < 30; $i += 1) {
32
38
  $[$i] = Symbol.for("react.memo_cache_sentinel");
33
39
  }
34
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
40
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
35
41
  }
36
42
  const {
37
43
  columns,
@@ -168,12 +174,12 @@ function TableHeader() {
168
174
  return t9;
169
175
  }
170
176
  function TableHeaderCell(t0) {
171
- const $ = c(43);
172
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
173
- for (let $i = 0; $i < 43; $i += 1) {
177
+ const $ = c(53);
178
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
179
+ for (let $i = 0; $i < 53; $i += 1) {
174
180
  $[$i] = Symbol.for("react.memo_cache_sentinel");
175
181
  }
176
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
182
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
177
183
  }
178
184
  const {
179
185
  columnIndex,
@@ -181,10 +187,12 @@ function TableHeaderCell(t0) {
181
187
  handleEditColumnsButtonClick
182
188
  } = t0;
183
189
  const ref = useRef(null);
190
+ const labelId = useId();
184
191
  const {
185
192
  columns,
186
193
  columnEditButton
187
194
  } = use(TablePropsContext);
195
+ const column = columns[columnIndex];
188
196
  const {
189
197
  key,
190
198
  name,
@@ -192,8 +200,9 @@ function TableHeaderCell(t0) {
192
200
  sortOrder,
193
201
  deletable,
194
202
  canReorder,
203
+ resizable,
195
204
  thClassName
196
- } = columns[columnIndex];
205
+ } = column;
197
206
  const {
198
207
  reorderAnimation
199
208
  } = use(ReorderAnimationContext);
@@ -207,10 +216,22 @@ function TableHeaderCell(t0) {
207
216
  } else {
208
217
  t1 = $[4];
209
218
  }
210
- const children = t1;
211
219
  let t2;
212
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
213
- t2 = () => {
220
+ if ($[5] !== labelId || $[6] !== t1) {
221
+ t2 = /*#__PURE__*/jsx("span", {
222
+ id: labelId,
223
+ children: t1
224
+ });
225
+ $[5] = labelId;
226
+ $[6] = t1;
227
+ $[7] = t2;
228
+ } else {
229
+ t2 = $[7];
230
+ }
231
+ const children = t2;
232
+ let t3;
233
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
234
+ t3 = () => {
214
235
  var _r$left, _r$right;
215
236
  const r = ref.current?.getBoundingClientRect();
216
237
  return {
@@ -218,153 +239,171 @@ function TableHeaderCell(t0) {
218
239
  end: (_r$right = r?.right) !== null && _r$right !== void 0 ? _r$right : 0
219
240
  };
220
241
  };
221
- $[5] = t2;
242
+ $[8] = t3;
222
243
  } else {
223
- t2 = $[5];
244
+ t3 = $[8];
224
245
  }
225
- let t3;
226
- if ($[6] !== columnIndex) {
227
- t3 = {
246
+ let t4;
247
+ if ($[9] !== columnIndex) {
248
+ t4 = {
228
249
  index: columnIndex,
229
- getBounds: t2
250
+ getBounds: t3
230
251
  };
231
- $[6] = columnIndex;
232
- $[7] = t3;
252
+ $[9] = columnIndex;
253
+ $[10] = t4;
233
254
  } else {
234
- t3 = $[7];
255
+ t4 = $[10];
235
256
  }
236
- useReorderItemLayout(t3);
237
- const t4 = reorderAnimation?.direction === "columns" && reorderAnimation.index === columnIndex && reorderAnimation.className;
238
- let t5;
239
- if ($[8] !== t4 || $[9] !== thClassName) {
240
- t5 = classNames(styles.headerCell, t4, thClassName);
241
- $[8] = t4;
242
- $[9] = thClassName;
243
- $[10] = t5;
257
+ useReorderItemLayout(t4);
258
+ const t5 = resizable && styles.resizableHeaderCell;
259
+ const t6 = reorderAnimation?.direction === "columns" && reorderAnimation.index === columnIndex && reorderAnimation.className;
260
+ let t7;
261
+ if ($[11] !== t5 || $[12] !== t6 || $[13] !== thClassName) {
262
+ t7 = classNames(styles.headerCell, t5, t6, thClassName);
263
+ $[11] = t5;
264
+ $[12] = t6;
265
+ $[13] = thClassName;
266
+ $[14] = t7;
244
267
  } else {
245
- t5 = $[10];
268
+ t7 = $[14];
246
269
  }
247
- let t6;
248
- if ($[11] !== canReorder || $[12] !== columnIndex) {
249
- t6 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandle, {
270
+ let t8;
271
+ if ($[15] !== canReorder || $[16] !== columnIndex) {
272
+ t8 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandle, {
250
273
  columnIndex: columnIndex
251
274
  });
252
- $[11] = canReorder;
253
- $[12] = columnIndex;
254
- $[13] = t6;
275
+ $[15] = canReorder;
276
+ $[16] = columnIndex;
277
+ $[17] = t8;
255
278
  } else {
256
- t6 = $[13];
279
+ t8 = $[17];
257
280
  }
258
- let t7;
259
- if ($[14] !== children || $[15] !== columnIndex || $[16] !== sortOrder) {
260
- t7 = sortOrder ? /*#__PURE__*/jsx(SortButton, {
281
+ let t9;
282
+ if ($[18] !== children || $[19] !== columnIndex || $[20] !== sortOrder) {
283
+ t9 = sortOrder ? /*#__PURE__*/jsx(SortButton, {
261
284
  columnIndex: columnIndex,
262
285
  "aria-description": `Sort order: ${sortOrder}`,
263
286
  children: children
264
287
  }) : children;
265
- $[14] = children;
266
- $[15] = columnIndex;
267
- $[16] = sortOrder;
268
- $[17] = t7;
288
+ $[18] = children;
289
+ $[19] = columnIndex;
290
+ $[20] = sortOrder;
291
+ $[21] = t9;
269
292
  } else {
270
- t7 = $[17];
293
+ t9 = $[21];
271
294
  }
272
- let t8;
273
- if ($[18] !== canReorder) {
274
- t8 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandleMirror, {});
275
- $[18] = canReorder;
276
- $[19] = t8;
295
+ let t10;
296
+ if ($[22] !== canReorder) {
297
+ t10 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandleMirror, {});
298
+ $[22] = canReorder;
299
+ $[23] = t10;
277
300
  } else {
278
- t8 = $[19];
301
+ t10 = $[23];
279
302
  }
280
- let t9;
281
- if ($[20] !== t6 || $[21] !== t7 || $[22] !== t8) {
282
- t9 = /*#__PURE__*/jsxs("div", {
303
+ let t11;
304
+ if ($[24] !== t10 || $[25] !== t8 || $[26] !== t9) {
305
+ t11 = /*#__PURE__*/jsxs("div", {
283
306
  className: styles.sortAndHeader,
284
- children: [t6, t7, t8]
307
+ children: [t8, t9, t10]
285
308
  });
286
- $[20] = t6;
287
- $[21] = t7;
288
- $[22] = t8;
289
- $[23] = t9;
309
+ $[24] = t10;
310
+ $[25] = t8;
311
+ $[26] = t9;
312
+ $[27] = t11;
290
313
  } else {
291
- t9 = $[23];
314
+ t11 = $[27];
292
315
  }
293
- let t10;
294
- if ($[24] !== columnIndex || $[25] !== deletable) {
295
- t10 = deletable && /*#__PURE__*/jsx(DeleteColumnButton, {
316
+ let t12;
317
+ if ($[28] !== columnIndex || $[29] !== deletable) {
318
+ t12 = deletable && /*#__PURE__*/jsx(DeleteColumnButton, {
296
319
  columnIndex: columnIndex
297
320
  });
298
- $[24] = columnIndex;
299
- $[25] = deletable;
300
- $[26] = t10;
321
+ $[28] = columnIndex;
322
+ $[29] = deletable;
323
+ $[30] = t12;
301
324
  } else {
302
- t10 = $[26];
325
+ t12 = $[30];
303
326
  }
304
- let t11;
305
- if ($[27] !== columnEditButton || $[28] !== columnEditing || $[29] !== columnIndex || $[30] !== columns.length || $[31] !== handleEditColumnsButtonClick) {
306
- t11 = columnIndex === columns.length - 1 && columnEditButton && /*#__PURE__*/jsx(EditColumnsButton, {
327
+ let t13;
328
+ if ($[31] !== columnEditButton || $[32] !== columnEditing || $[33] !== columnIndex || $[34] !== columns.length || $[35] !== handleEditColumnsButtonClick) {
329
+ t13 = columnIndex === columns.length - 1 && columnEditButton && /*#__PURE__*/jsx(EditColumnsButton, {
307
330
  columnEditing: columnEditing,
308
331
  onClick: handleEditColumnsButtonClick
309
332
  });
310
- $[27] = columnEditButton;
311
- $[28] = columnEditing;
312
- $[29] = columnIndex;
313
- $[30] = columns.length;
314
- $[31] = handleEditColumnsButtonClick;
315
- $[32] = t11;
333
+ $[31] = columnEditButton;
334
+ $[32] = columnEditing;
335
+ $[33] = columnIndex;
336
+ $[34] = columns.length;
337
+ $[35] = handleEditColumnsButtonClick;
338
+ $[36] = t13;
316
339
  } else {
317
- t11 = $[32];
340
+ t13 = $[36];
318
341
  }
319
- let t12;
320
- if ($[33] !== t10 || $[34] !== t11) {
321
- t12 = /*#__PURE__*/jsxs("div", {
342
+ let t14;
343
+ if ($[37] !== t12 || $[38] !== t13) {
344
+ t14 = /*#__PURE__*/jsxs("div", {
322
345
  className: styles.rightButtons,
323
- children: [t10, t11]
346
+ children: [t12, t13]
324
347
  });
325
- $[33] = t10;
326
- $[34] = t11;
327
- $[35] = t12;
348
+ $[37] = t12;
349
+ $[38] = t13;
350
+ $[39] = t14;
328
351
  } else {
329
- t12 = $[35];
352
+ t14 = $[39];
330
353
  }
331
- let t13;
332
- if ($[36] !== t12 || $[37] !== t9) {
333
- t13 = /*#__PURE__*/jsxs("div", {
354
+ let t15;
355
+ if ($[40] !== t11 || $[41] !== t14) {
356
+ t15 = /*#__PURE__*/jsxs("div", {
334
357
  className: styles.headerCellInnerWrapper,
335
- children: [t9, t12]
358
+ children: [t11, t14]
336
359
  });
337
- $[36] = t12;
338
- $[37] = t9;
339
- $[38] = t13;
360
+ $[40] = t11;
361
+ $[41] = t14;
362
+ $[42] = t15;
340
363
  } else {
341
- t13 = $[38];
364
+ t15 = $[42];
342
365
  }
343
- let t14;
344
- if ($[39] !== sortOrder || $[40] !== t13 || $[41] !== t5) {
345
- t14 = /*#__PURE__*/jsx("th", {
366
+ let t16;
367
+ if ($[43] !== column || $[44] !== columnIndex || $[45] !== resizable) {
368
+ t16 = resizable && /*#__PURE__*/jsx(ColumnResizeHandle, {
369
+ column: column,
370
+ columnIndex: columnIndex
371
+ });
372
+ $[43] = column;
373
+ $[44] = columnIndex;
374
+ $[45] = resizable;
375
+ $[46] = t16;
376
+ } else {
377
+ t16 = $[46];
378
+ }
379
+ let t17;
380
+ if ($[47] !== labelId || $[48] !== sortOrder || $[49] !== t15 || $[50] !== t16 || $[51] !== t7) {
381
+ t17 = /*#__PURE__*/jsxs("th", {
346
382
  ref: ref,
347
- className: t5,
383
+ className: t7,
348
384
  scope: "col",
349
385
  "aria-sort": sortOrder,
350
- children: t13
386
+ "aria-labelledby": labelId,
387
+ children: [t15, t16]
351
388
  });
352
- $[39] = sortOrder;
353
- $[40] = t13;
354
- $[41] = t5;
355
- $[42] = t14;
389
+ $[47] = labelId;
390
+ $[48] = sortOrder;
391
+ $[49] = t15;
392
+ $[50] = t16;
393
+ $[51] = t7;
394
+ $[52] = t17;
356
395
  } else {
357
- t14 = $[42];
396
+ t17 = $[52];
358
397
  }
359
- return t14;
398
+ return t17;
360
399
  }
361
400
  function SortButton(t0) {
362
401
  const $ = c(22);
363
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
402
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
364
403
  for (let $i = 0; $i < 22; $i += 1) {
365
404
  $[$i] = Symbol.for("react.memo_cache_sentinel");
366
405
  }
367
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
406
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
368
407
  }
369
408
  let children;
370
409
  let className;
@@ -459,11 +498,11 @@ function SortButton(t0) {
459
498
  function DeleteColumnButton(t0) {
460
499
  var _column$name;
461
500
  const $ = c(18);
462
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
501
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
463
502
  for (let $i = 0; $i < 18; $i += 1) {
464
503
  $[$i] = Symbol.for("react.memo_cache_sentinel");
465
504
  }
466
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
505
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
467
506
  }
468
507
  let className;
469
508
  let columnIndex;
@@ -551,11 +590,11 @@ function DeleteColumnButton(t0) {
551
590
  }
552
591
  function EditColumnsButton(t0) {
553
592
  const $ = c(14);
554
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
593
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
555
594
  for (let $i = 0; $i < 14; $i += 1) {
556
595
  $[$i] = Symbol.for("react.memo_cache_sentinel");
557
596
  }
558
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
597
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
559
598
  }
560
599
  let columnEditing;
561
600
  let hint;
@@ -623,11 +662,11 @@ function EditColumnsButton(t0) {
623
662
  }
624
663
  function ColumnReorderHandle(t0) {
625
664
  const $ = c(7);
626
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
665
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
627
666
  for (let $i = 0; $i < 7; $i += 1) {
628
667
  $[$i] = Symbol.for("react.memo_cache_sentinel");
629
668
  }
630
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
669
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
631
670
  }
632
671
  let columnIndex;
633
672
  let restProps;
@@ -663,11 +702,11 @@ function ColumnReorderHandle(t0) {
663
702
  */
664
703
  function ColumnReorderHandleMirror() {
665
704
  const $ = c(2);
666
- if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
705
+ if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
667
706
  for (let $i = 0; $i < 2; $i += 1) {
668
707
  $[$i] = Symbol.for("react.memo_cache_sentinel");
669
708
  }
670
- $[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
709
+ $[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
671
710
  }
672
711
  let t0;
673
712
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
@@ -1,5 +1,4 @@
1
1
  import { Component, type Ref, type HTMLAttributes } from 'react';
2
- import createResizeDetector from 'element-resize-detector';
3
2
  export interface IslandContentProps extends Omit<HTMLAttributes<HTMLElement>, 'onScroll'> {
4
3
  ref?: Ref<Content>;
5
4
  fade?: boolean | null | undefined;
@@ -20,11 +19,10 @@ declare class Content extends Component<IslandContentInnerProps> {
20
19
  };
21
20
  state: {
22
21
  scrolledToTop: boolean;
23
- scrolledToBottom: boolean;
22
+ showBottomFade: boolean;
24
23
  };
25
24
  componentWillUnmount(): void;
26
- resizeDetector: createResizeDetector.Erd;
27
- wrapperNode?: HTMLElement | null;
25
+ wrapperResizeObserver?: ResizeObserver;
28
26
  setWrapper: (node: HTMLElement | null) => void;
29
27
  calculateScrollPosition: () => void;
30
28
  scrollableNode?: HTMLElement | null;
@@ -1,7 +1,6 @@
1
1
  import { c } from 'react/compiler-runtime';
2
2
  import { Component } from 'react';
3
3
  import classNames from 'classnames';
4
- import createResizeDetector from 'element-resize-detector';
5
4
  import scheduleRAF from '../global/schedule-raf.js';
6
5
  import { ScrollHandlerContext } from './adaptive-island-hoc.js';
7
6
  import { s as styles } from '../_helpers/island.js';
@@ -10,7 +9,10 @@ import '../global/linear-function.js';
10
9
 
11
10
  const scheduleScrollAction = scheduleRAF();
12
11
  const noop = () => {};
13
- const END_DISTANCE = 16;
12
+ // `onScrollToBottom` keeps the legacy 16px allowance so callbacks still fire when subpixel rounding or
13
+ // zoom leaves a small gap, while the visual fade hides only at the exact bottom edge.
14
+ const CALLBACK_END_DISTANCE = 16;
15
+ const FADE_END_DISTANCE = 1;
14
16
  class Content extends Component {
15
17
  static defaultProps = {
16
18
  fade: true,
@@ -20,25 +22,22 @@ class Content extends Component {
20
22
  };
21
23
  state = {
22
24
  scrolledToTop: true,
23
- scrolledToBottom: false
25
+ showBottomFade: false
24
26
  };
25
27
  componentWillUnmount() {
26
28
  this.scrollableNode = null;
27
- if (!this.wrapperNode) {
28
- return;
29
- }
30
- this.resizeDetector.removeAllListeners(this.wrapperNode);
29
+ this.wrapperResizeObserver?.disconnect();
31
30
  }
32
- resizeDetector = createResizeDetector({
33
- strategy: 'scroll'
34
- });
35
- wrapperNode;
31
+ wrapperResizeObserver;
36
32
  setWrapper = node => {
37
33
  if (!node) {
38
34
  return;
39
35
  }
40
- this.wrapperNode = node;
41
- this.resizeDetector.listenTo(node, this.calculateScrollPosition);
36
+ this.wrapperResizeObserver?.disconnect();
37
+ this.wrapperResizeObserver = new ResizeObserver(() => {
38
+ this.calculateScrollPosition();
39
+ });
40
+ this.wrapperResizeObserver.observe(node);
42
41
  };
43
42
  calculateScrollPosition = () => scheduleScrollAction(() => {
44
43
  const {
@@ -54,13 +53,14 @@ class Content extends Component {
54
53
  offsetHeight
55
54
  } = scrollableNode;
56
55
  const scrolledToTop = scrollTop === 0;
57
- const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
58
- if (scrolledToBottom) {
56
+ const showBottomFade = offsetHeight + scrollTop >= scrollHeight - FADE_END_DISTANCE;
57
+ const isNearBottom = offsetHeight > 0 && offsetHeight + scrollTop >= scrollHeight - CALLBACK_END_DISTANCE;
58
+ if (isNearBottom) {
59
59
  this.props.onScrollToBottom?.();
60
60
  }
61
61
  this.setState({
62
62
  scrolledToTop,
63
- scrolledToBottom
63
+ showBottomFade
64
64
  });
65
65
  });
66
66
  scrollableNode;
@@ -86,13 +86,13 @@ class Content extends Component {
86
86
  } = this.props;
87
87
  const {
88
88
  scrolledToTop,
89
- scrolledToBottom
89
+ showBottomFade
90
90
  } = this.state;
91
91
  const classes = classNames(styles.content, className, {
92
92
  [styles.contentWithTopFade]: fade && !scrolledToTop,
93
- [styles.contentWithBottomFade]: fade && !scrolledToBottom,
93
+ [styles.contentWithBottomFade]: fade && !showBottomFade,
94
94
  [styles.withTransparentBottomBorder]: bottomBorder,
95
- [styles.withBottomBorder]: bottomBorder && !scrolledToBottom
95
+ [styles.withBottomBorder]: bottomBorder && !showBottomFade
96
96
  });
97
97
  const scrollableWrapperClasses = classNames(styles.scrollableWrapper, scrollableWrapperClassName);
98
98
  return /*#__PURE__*/jsx("div", {
@@ -114,11 +114,11 @@ class Content extends Component {
114
114
  }
115
115
  const ContentWrapper = t0 => {
116
116
  const $ = c(5);
117
- if ($[0] !== "e4db06b946c16f75a9eac1dc4434adb1fda7cf8013533176d779915994c312c4") {
117
+ if ($[0] !== "df1ec5d93922f12587fd3db6b559dd3360b591c94eca864dcfb78d805d49fd83") {
118
118
  for (let $i = 0; $i < 5; $i += 1) {
119
119
  $[$i] = Symbol.for("react.memo_cache_sentinel");
120
120
  }
121
- $[0] = "e4db06b946c16f75a9eac1dc4434adb1fda7cf8013533176d779915994c312c4";
121
+ $[0] = "df1ec5d93922f12587fd3db6b559dd3360b591c94eca864dcfb78d805d49fd83";
122
122
  }
123
123
  let props;
124
124
  if ($[1] !== t0) {
@@ -8,7 +8,6 @@ export { default as Header } from './header.js';
8
8
  export { default as Content } from './content.js';
9
9
  import '../global/linear-function.js';
10
10
  import 'react/compiler-runtime';
11
- import 'element-resize-detector';
12
11
  import '../global/schedule-raf.js';
13
12
 
14
13
  class Island extends Component {
@@ -13,7 +13,6 @@ import '../global/data-tests.js';
13
13
  import '../island/adaptive-island-hoc.js';
14
14
  import '../global/linear-function.js';
15
15
  import '../island/header.js';
16
- import 'element-resize-detector';
17
16
  import '../global/schedule-raf.js';
18
17
  import '../global/get-uid.js';
19
18
  import '../shortcuts/shortcuts.js';
@@ -16,7 +16,6 @@ import '../_helpers/island.js';
16
16
  import '../island/header.js';
17
17
  import 'react/compiler-runtime';
18
18
  import '../island/content.js';
19
- import 'element-resize-detector';
20
19
  import '../global/schedule-raf.js';
21
20
  import '../global/get-uid.js';
22
21
  import '../shortcuts/shortcuts.js';