@jetbrains/ring-ui-built 7.0.115 → 7.0.116

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.
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import * as React from 'react';
3
- import { useEffect } from 'react';
3
+ import { useLayoutEffect, useEffect } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import Heading, { Levels } from '../heading/heading.js';
6
6
  import { Button } from '../button/button.js';
@@ -39,12 +39,12 @@ var styles = {"editableHeading":"ring-editable-heading-editableHeading","fullSiz
39
39
  function noop() {}
40
40
  // eslint-disable-next-line complexity
41
41
  const EditableHeading = props => {
42
- const $ = c(129);
43
- if ($[0] !== "3ac267c2661a712752bc17aadc2ab1fd112b0978580f58998a2e6034e2034a23") {
44
- for (let $i = 0; $i < 129; $i += 1) {
42
+ const $ = c(134);
43
+ if ($[0] !== "07354b4b5f4ebcba544bc9d3e840d7068d1f2b93d046629ed3331f3bf1ebf45b") {
44
+ for (let $i = 0; $i < 134; $i += 1) {
45
45
  $[$i] = Symbol.for("react.memo_cache_sentinel");
46
46
  }
47
- $[0] = "3ac267c2661a712752bc17aadc2ab1fd112b0978580f58998a2e6034e2034a23";
47
+ $[0] = "07354b4b5f4ebcba544bc9d3e840d7068d1f2b93d046629ed3331f3bf1ebf45b";
48
48
  }
49
49
  let children;
50
50
  let className;
@@ -275,12 +275,16 @@ const EditableHeading = props => {
275
275
  t21 = $[56];
276
276
  }
277
277
  const inputClasses = t21;
278
- const stretch = _temp2;
279
278
  let t22;
280
279
  if ($[57] !== multiline) {
281
- t22 = el_0 => {
282
- if (multiline && el_0 && el_0.scrollHeight >= el_0.clientHeight) {
283
- stretch(el_0);
280
+ t22 = el => {
281
+ if (multiline && el && el.scrollHeight >= el.clientHeight) {
282
+ el.style.height = "0";
283
+ const {
284
+ paddingTop,
285
+ paddingBottom
286
+ } = window.getComputedStyle(el);
287
+ el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
284
288
  }
285
289
  };
286
290
  $[57] = multiline;
@@ -291,10 +295,10 @@ const EditableHeading = props => {
291
295
  const checkValue = t22;
292
296
  let t23;
293
297
  if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
294
- t23 = el_1 => {
295
- const scrollHeight = el_1.scrollHeight || 0;
296
- const clientHeight = el_1.clientHeight || 0;
297
- const scrollTop = el_1.scrollTop || 0;
298
+ t23 = el_0 => {
299
+ const scrollHeight = el_0.scrollHeight || 0;
300
+ const clientHeight = el_0.clientHeight || 0;
301
+ const scrollTop = el_0.scrollTop || 0;
298
302
  setIsScrolledToBottom(scrollHeight - clientHeight <= scrollTop);
299
303
  setIsOverflow(scrollHeight > clientHeight);
300
304
  };
@@ -400,8 +404,28 @@ const EditableHeading = props => {
400
404
  const onInputBlur = t30;
401
405
  let t31;
402
406
  let t32;
403
- if ($[78] !== onMouseMove || $[79] !== onMouseUp) {
407
+ if ($[78] !== checkValue || $[79] !== isEditing || $[80] !== multiline) {
404
408
  t31 = () => {
409
+ if (multiline && isEditing && textAreaRef.current) {
410
+ checkValue(textAreaRef.current);
411
+ checkOverflow(textAreaRef.current);
412
+ }
413
+ };
414
+ t32 = [checkOverflow, checkValue, isEditing, multiline];
415
+ $[78] = checkValue;
416
+ $[79] = isEditing;
417
+ $[80] = multiline;
418
+ $[81] = t31;
419
+ $[82] = t32;
420
+ } else {
421
+ t31 = $[81];
422
+ t32 = $[82];
423
+ }
424
+ useLayoutEffect(t31, t32);
425
+ let t33;
426
+ let t34;
427
+ if ($[83] !== onMouseMove || $[84] !== onMouseUp) {
428
+ t33 = () => {
405
429
  window.addEventListener("mousemove", onMouseMove);
406
430
  window.addEventListener("mouseup", onMouseUp);
407
431
  return () => {
@@ -409,19 +433,19 @@ const EditableHeading = props => {
409
433
  window.removeEventListener("mouseup", onMouseUp);
410
434
  };
411
435
  };
412
- t32 = [onMouseMove, onMouseUp];
413
- $[78] = onMouseMove;
414
- $[79] = onMouseUp;
415
- $[80] = t31;
416
- $[81] = t32;
436
+ t34 = [onMouseMove, onMouseUp];
437
+ $[83] = onMouseMove;
438
+ $[84] = onMouseUp;
439
+ $[85] = t33;
440
+ $[86] = t34;
417
441
  } else {
418
- t31 = $[80];
419
- t32 = $[81];
442
+ t33 = $[85];
443
+ t34 = $[86];
420
444
  }
421
- useEffect(t31, t32);
422
- let t33;
423
- if ($[82] !== autoFocus || $[83] !== children || $[84] !== dataTest || $[85] !== disabled || $[86] !== headingClasses || $[87] !== inputClasses || $[88] !== isEditing || $[89] !== isSaving || $[90] !== isScrolledToBottom || $[91] !== isShortcutsDisabled || $[92] !== level || $[93] !== maxInputRows || $[94] !== multiline || $[95] !== onChange || $[96] !== onInputBlur || $[97] !== onInputChange || $[98] !== onInputFocus || $[99] !== onInputScroll || $[100] !== restProps || $[101] !== shortcutsMap || $[102] !== shortcutsScope || $[103] !== size) {
424
- t33 = !disabled && isEditing ? /*#__PURE__*/jsxs(Fragment, {
445
+ useEffect(t33, t34);
446
+ let t35;
447
+ if ($[87] !== autoFocus || $[88] !== children || $[89] !== dataTest || $[90] !== disabled || $[91] !== headingClasses || $[92] !== inputClasses || $[93] !== isEditing || $[94] !== isSaving || $[95] !== isScrolledToBottom || $[96] !== isShortcutsDisabled || $[97] !== level || $[98] !== maxInputRows || $[99] !== multiline || $[100] !== onChange || $[101] !== onInputBlur || $[102] !== onInputChange || $[103] !== onInputFocus || $[104] !== onInputScroll || $[105] !== restProps || $[106] !== shortcutsMap || $[107] !== shortcutsScope || $[108] !== size) {
448
+ t35 = !disabled && isEditing ? /*#__PURE__*/jsxs(Fragment, {
425
449
  children: [/*#__PURE__*/jsx(Shortcuts, {
426
450
  map: shortcutsMap,
427
451
  scope: shortcutsScope,
@@ -468,44 +492,44 @@ const EditableHeading = props => {
468
492
  children: children
469
493
  })
470
494
  });
471
- $[82] = autoFocus;
472
- $[83] = children;
473
- $[84] = dataTest;
474
- $[85] = disabled;
475
- $[86] = headingClasses;
476
- $[87] = inputClasses;
477
- $[88] = isEditing;
478
- $[89] = isSaving;
479
- $[90] = isScrolledToBottom;
480
- $[91] = isShortcutsDisabled;
481
- $[92] = level;
482
- $[93] = maxInputRows;
483
- $[94] = multiline;
484
- $[95] = onChange;
485
- $[96] = onInputBlur;
486
- $[97] = onInputChange;
487
- $[98] = onInputFocus;
488
- $[99] = onInputScroll;
489
- $[100] = restProps;
490
- $[101] = shortcutsMap;
491
- $[102] = shortcutsScope;
492
- $[103] = size;
493
- $[104] = t33;
495
+ $[87] = autoFocus;
496
+ $[88] = children;
497
+ $[89] = dataTest;
498
+ $[90] = disabled;
499
+ $[91] = headingClasses;
500
+ $[92] = inputClasses;
501
+ $[93] = isEditing;
502
+ $[94] = isSaving;
503
+ $[95] = isScrolledToBottom;
504
+ $[96] = isShortcutsDisabled;
505
+ $[97] = level;
506
+ $[98] = maxInputRows;
507
+ $[99] = multiline;
508
+ $[100] = onChange;
509
+ $[101] = onInputBlur;
510
+ $[102] = onInputChange;
511
+ $[103] = onInputFocus;
512
+ $[104] = onInputScroll;
513
+ $[105] = restProps;
514
+ $[106] = shortcutsMap;
515
+ $[107] = shortcutsScope;
516
+ $[108] = size;
517
+ $[109] = t35;
494
518
  } else {
495
- t33 = $[104];
519
+ t35 = $[109];
496
520
  }
497
- let t34;
498
- if ($[105] !== isEditing || $[106] !== renderMenu) {
499
- t34 = !isEditing && renderMenu();
500
- $[105] = isEditing;
501
- $[106] = renderMenu;
502
- $[107] = t34;
521
+ let t36;
522
+ if ($[110] !== isEditing || $[111] !== renderMenu) {
523
+ t36 = !isEditing && renderMenu();
524
+ $[110] = isEditing;
525
+ $[111] = renderMenu;
526
+ $[112] = t36;
503
527
  } else {
504
- t34 = $[107];
528
+ t36 = $[112];
505
529
  }
506
- let t35;
507
- if ($[108] !== embedded || $[109] !== isCancelDisabled || $[110] !== isEditing || $[111] !== isSaveDisabled || $[112] !== isSaving || $[113] !== onCancel || $[114] !== onSave || $[115] !== translations) {
508
- t35 = isEditing && !embedded && /*#__PURE__*/jsxs(Fragment, {
530
+ let t37;
531
+ if ($[113] !== embedded || $[114] !== isCancelDisabled || $[115] !== isEditing || $[116] !== isSaveDisabled || $[117] !== isSaving || $[118] !== onCancel || $[119] !== onSave || $[120] !== translations) {
532
+ t37 = isEditing && !embedded && /*#__PURE__*/jsxs(Fragment, {
509
533
  children: [/*#__PURE__*/jsx(Button, {
510
534
  className: styles.button,
511
535
  primary: true,
@@ -520,72 +544,61 @@ const EditableHeading = props => {
520
544
  children: translations.cancel
521
545
  })]
522
546
  });
523
- $[108] = embedded;
524
- $[109] = isCancelDisabled;
525
- $[110] = isEditing;
526
- $[111] = isSaveDisabled;
527
- $[112] = isSaving;
528
- $[113] = onCancel;
529
- $[114] = onSave;
530
- $[115] = translations;
531
- $[116] = t35;
547
+ $[113] = embedded;
548
+ $[114] = isCancelDisabled;
549
+ $[115] = isEditing;
550
+ $[116] = isSaveDisabled;
551
+ $[117] = isSaving;
552
+ $[118] = onCancel;
553
+ $[119] = onSave;
554
+ $[120] = translations;
555
+ $[121] = t37;
532
556
  } else {
533
- t35 = $[116];
557
+ t37 = $[121];
534
558
  }
535
- let t36;
536
- if ($[117] !== classes || $[118] !== t33 || $[119] !== t34 || $[120] !== t35) {
537
- t36 = /*#__PURE__*/jsxs("div", {
559
+ let t38;
560
+ if ($[122] !== classes || $[123] !== t35 || $[124] !== t36 || $[125] !== t37) {
561
+ t38 = /*#__PURE__*/jsxs("div", {
538
562
  className: classes,
539
- children: [t33, t34, t35]
563
+ children: [t35, t36, t37]
540
564
  });
541
- $[117] = classes;
542
- $[118] = t33;
543
- $[119] = t34;
544
- $[120] = t35;
545
- $[121] = t36;
565
+ $[122] = classes;
566
+ $[123] = t35;
567
+ $[124] = t36;
568
+ $[125] = t37;
569
+ $[126] = t38;
546
570
  } else {
547
- t36 = $[121];
571
+ t38 = $[126];
548
572
  }
549
- let t37;
550
- if ($[122] !== error || $[123] !== isEditing || $[124] !== size) {
551
- t37 = isEditing && error && /*#__PURE__*/jsx("div", {
573
+ let t39;
574
+ if ($[127] !== error || $[128] !== isEditing || $[129] !== size) {
575
+ t39 = isEditing && error && /*#__PURE__*/jsx("div", {
552
576
  className: classNames(styles.errorText, size !== Size.AUTO && inputStyles[`size${size}`]),
553
577
  children: error
554
578
  });
555
- $[122] = error;
556
- $[123] = isEditing;
557
- $[124] = size;
558
- $[125] = t37;
579
+ $[127] = error;
580
+ $[128] = isEditing;
581
+ $[129] = size;
582
+ $[130] = t39;
559
583
  } else {
560
- t37 = $[125];
584
+ t39 = $[130];
561
585
  }
562
- let t38;
563
- if ($[126] !== t36 || $[127] !== t37) {
564
- t38 = /*#__PURE__*/jsxs(Fragment, {
565
- children: [t36, t37]
586
+ let t40;
587
+ if ($[131] !== t38 || $[132] !== t39) {
588
+ t40 = /*#__PURE__*/jsxs(Fragment, {
589
+ children: [t38, t39]
566
590
  });
567
- $[126] = t36;
568
- $[127] = t37;
569
- $[128] = t38;
591
+ $[131] = t38;
592
+ $[132] = t39;
593
+ $[133] = t40;
570
594
  } else {
571
- t38 = $[128];
595
+ t40 = $[133];
572
596
  }
573
- return t38;
597
+ return t40;
574
598
  };
575
599
  var editableHeading = /*#__PURE__*/React.memo(EditableHeading);
576
600
  function _temp() {
577
601
  return null;
578
602
  }
579
- function _temp2(el) {
580
- if (!el || !el.style) {
581
- return;
582
- }
583
- el.style.height = "0";
584
- const {
585
- paddingTop,
586
- paddingBottom
587
- } = window.getComputedStyle(el);
588
- el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
589
- }
590
603
 
591
604
  export { EditableHeading, Levels, Size, editableHeading as default };
@@ -1,16 +1,8 @@
1
- import React from 'react';
2
- export interface CollapsibleGroupProps {
3
- avatar?: React.ReactNode;
4
- title: React.ReactNode;
5
- subtitle?: React.ReactNode;
6
- children?: React.ReactNode;
7
- className?: string | null | undefined;
8
- defaultExpanded?: boolean;
9
- expanded?: boolean | null | undefined;
10
- onChange?: (expanded: boolean) => void;
11
- disableAnimation?: boolean;
12
- interactive?: boolean;
13
- 'data-test'?: string | null | undefined;
14
- }
15
- declare const CollapsibleGroup: React.ForwardRefExoticComponent<CollapsibleGroupProps & React.RefAttributes<HTMLDivElement>>;
16
- export default CollapsibleGroup;
1
+ import { type CollapsibleGroupProps } from '../collapsible-group/collapsible-group';
2
+ /**
3
+ * @deprecated The `expand` module has been renamed to `collapsible-group`. This re-export will be removed in
4
+ * Ring UI 8.0. Use `CollapsibleGroup` from `@jetbrains/ring-ui/components/collapsible-group/collapsible-group` instead.
5
+ */
6
+ declare const DeprecatedCollapsibleGroup: import("react").ForwardRefExoticComponent<CollapsibleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export type { CollapsibleGroupProps };
8
+ export default DeprecatedCollapsibleGroup;