@ringcentral/juno 2.10.0 → 2.12.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.
Files changed (86) hide show
  1. package/components/Dialer/DialPad/DialPad.js +1 -1
  2. package/components/Dialer/DialPadButton/DialPadButton.d.ts +3 -1
  3. package/components/Dialer/DialPadButton/DialPadButton.js +3 -3
  4. package/components/Dialog/Dialog.js +4 -2
  5. package/components/Downshift/SuggestionList/SuggestionList.d.ts +3 -3
  6. package/components/Drawer/Drawer.js +3 -1
  7. package/components/Forms/TextField/TextField.d.ts +2 -2
  8. package/components/Forms/TextField/TextField.js +19 -4
  9. package/components/PortalHost/context/HasPortalParentContext.d.ts +3 -0
  10. package/components/PortalHost/context/HasPortalParentContext.js +9 -0
  11. package/components/PortalHost/context/index.d.ts +1 -0
  12. package/components/PortalHost/context/index.js +1 -0
  13. package/components/PortalHost/index.d.ts +1 -0
  14. package/components/PortalHost/index.js +2 -0
  15. package/components/PortalHost/utils/usePortalManagerWithID.js +5 -4
  16. package/components/Snackbar/Snackbar.js +3 -1
  17. package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +17 -13
  18. package/components/VirtualizedMenu/VirtualizedMenu.js +4 -12
  19. package/components/Virtuoso/react-virtuoso/Grid.d.ts +28 -18
  20. package/components/Virtuoso/react-virtuoso/List.d.ts +487 -183
  21. package/components/Virtuoso/react-virtuoso/List.js +13 -2
  22. package/components/Virtuoso/react-virtuoso/Table.d.ts +434 -172
  23. package/components/Virtuoso/react-virtuoso/Table.js +14 -2
  24. package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +32 -16
  25. package/components/Virtuoso/react-virtuoso/components.d.ts +8 -0
  26. package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +3 -1
  27. package/components/Virtuoso/react-virtuoso/domIOSystem.js +4 -2
  28. package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +20 -10
  29. package/components/Virtuoso/react-virtuoso/followOutputSystem.js +1 -0
  30. package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +24 -14
  31. package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +4 -2
  32. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +2 -1
  33. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +5 -10
  34. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +2 -1
  35. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +16 -7
  36. package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +2 -2
  37. package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +24 -12
  38. package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +32 -16
  39. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +8 -4
  40. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +1 -1
  41. package/components/Virtuoso/react-virtuoso/interfaces.d.ts +22 -5
  42. package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +24 -12
  43. package/components/Virtuoso/react-virtuoso/listSystem.d.ts +287 -146
  44. package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +32 -16
  45. package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +4 -2
  46. package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +4 -2
  47. package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +4 -2
  48. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +4 -2
  49. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +5 -4
  50. package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +24 -12
  51. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +28 -14
  52. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +4 -0
  53. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +32 -16
  54. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +12 -35
  55. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.d.ts +1 -0
  56. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +11 -0
  57. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +6 -4
  58. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +6 -2
  59. package/components/Virtuoso/utils/useHighlightScroll.js +1 -2
  60. package/es6/components/Dialer/DialPad/DialPad.js +1 -1
  61. package/es6/components/Dialer/DialPadButton/DialPadButton.js +3 -3
  62. package/es6/components/Dialog/Dialog.js +4 -2
  63. package/es6/components/Drawer/Drawer.js +3 -1
  64. package/es6/components/Forms/TextField/TextField.js +20 -5
  65. package/es6/components/PortalHost/context/HasPortalParentContext.js +6 -0
  66. package/es6/components/PortalHost/context/index.js +1 -0
  67. package/es6/components/PortalHost/index.js +1 -0
  68. package/es6/components/PortalHost/utils/usePortalManagerWithID.js +5 -4
  69. package/es6/components/Snackbar/Snackbar.js +3 -1
  70. package/es6/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +17 -13
  71. package/es6/components/VirtualizedMenu/VirtualizedMenu.js +6 -14
  72. package/es6/components/Virtuoso/react-virtuoso/List.js +14 -3
  73. package/es6/components/Virtuoso/react-virtuoso/Table.js +14 -2
  74. package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +4 -3
  75. package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +1 -0
  76. package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +5 -10
  77. package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +16 -7
  78. package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +2 -2
  79. package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +1 -1
  80. package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +5 -4
  81. package/es6/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +4 -0
  82. package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +12 -35
  83. package/es6/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +8 -0
  84. package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +6 -2
  85. package/es6/components/Virtuoso/utils/useHighlightScroll.js +1 -2
  86. package/package.json +2 -2
@@ -1,5 +1,4 @@
1
1
  import { __read } from "tslib";
2
- /* eslint-disable no-continue */
3
2
  import * as u from '@virtuoso.dev/urx';
4
3
  import { domIOSystem } from './domIOSystem';
5
4
  import { listStateSystem } from './listStateSystem';
@@ -11,49 +10,27 @@ import { stateFlagsSystem, UP } from './stateFlagsSystem';
11
10
  */
12
11
  export var upwardScrollFixSystem = u.system(function (_a) {
13
12
  var _b = __read(_a, 5), _c = _b[0], scrollBy = _c.scrollBy, scrollTop = _c.scrollTop, deviation = _c.deviation, scrollingInProgress = _c.scrollingInProgress, _d = _b[1], isScrolling = _d.isScrolling, isAtBottom = _d.isAtBottom, atBottomState = _d.atBottomState, scrollDirection = _d.scrollDirection, lastJumpDueToItemResize = _d.lastJumpDueToItemResize, listState = _b[2].listState, _e = _b[3], beforeUnshiftWith = _e.beforeUnshiftWith, shiftWithOffset = _e.shiftWithOffset, sizes = _e.sizes, log = _b[4].log;
14
- var deviationOffset = u.streamFromEmitter(u.pipe(listState, u.withLatestFrom(lastJumpDueToItemResize), u.scan(function (_a,
15
- // @ts-ignore
16
- _b) {
17
- var _c = __read(_a, 3), prevItems = _c[1], prevTotalCount = _c[2];
18
- var
13
+ var deviationOffset = u.streamFromEmitter(u.pipe(listState, u.withLatestFrom(lastJumpDueToItemResize), u.scan(function (_a, _b) {
14
+ var _c = __read(_a, 4), prevItems = _c[1], prevTotalCount = _c[2], prevTotalHeight = _c[3];
15
+ var _d = __read(_b, 2),
19
16
  // @ts-ignore
20
- _d = __read(_b, 2), _e = _d[0], items = _e.items, totalCount = _e.totalCount, lastJumpDueToItemResize = _d[1];
17
+ _e = _d[0], items = _e.items, totalCount = _e.totalCount, bottom = _e.bottom, offsetBottom = _e.offsetBottom, lastJumpDueToItemResize = _d[1];
18
+ var totalHeight = bottom + offsetBottom;
21
19
  var newDev = 0;
22
20
  if (prevTotalCount === totalCount) {
23
21
  if (prevItems.length > 0 && items.length > 0) {
24
- var firstItemIndex = items[0].originalIndex;
25
- var prevFirstItemIndex = prevItems[0].originalIndex;
26
- var atStart = firstItemIndex === 0 && prevFirstItemIndex === 0;
27
- var onlyItem = items.length === 1;
22
+ var atStart = items[0].originalIndex === 0 &&
23
+ prevItems[0].originalIndex === 0;
28
24
  if (!atStart) {
29
- var _loop_1 = function (index) {
30
- var item = items[index];
31
- var prevItem = prevItems.find(function (pItem) { return pItem.originalIndex === item.originalIndex; });
32
- if (!prevItem) {
33
- return "continue";
34
- }
35
- if (item.offset !== prevItem.offset || onlyItem) {
36
- newDev =
37
- item.offset -
38
- prevItem.offset +
39
- item.size -
40
- prevItem.size;
41
- return "break";
42
- }
43
- };
44
- for (var index = items.length - 1; index >= 0; index--) {
45
- var state_1 = _loop_1(index);
46
- if (state_1 === "break")
47
- break;
25
+ newDev = totalHeight - prevTotalHeight;
26
+ if (newDev !== 0) {
27
+ newDev += lastJumpDueToItemResize;
48
28
  }
49
29
  }
50
30
  }
51
- if (newDev !== 0) {
52
- newDev += lastJumpDueToItemResize;
53
- }
54
31
  }
55
- return [newDev, items, totalCount];
56
- }, [0, [], 0]), u.filter(function (_a) {
32
+ return [newDev, items, totalCount, totalHeight];
33
+ }, [0, [], 0, 0]), u.filter(function (_a) {
57
34
  var _b = __read(_a, 1), amount = _b[0];
58
35
  return amount !== 0;
59
36
  }), u.withLatestFrom(scrollTop, scrollDirection, scrollingInProgress, log, isAtBottom, atBottomState), u.filter(function (_a) {
@@ -0,0 +1,8 @@
1
+ // TODO: framer still not have flushSync in there framer version, skip that temporarily
2
+ // import { flushSync } from 'react-dom';
3
+ export default function conditionalFlushSync(
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ flag) {
6
+ // return flag ? flushSync : (cb: () => void) => cb();
7
+ return function (cb) { return cb(); };
8
+ }
@@ -9,8 +9,12 @@ export var windowScrollerSystem = u.system(function (_a) {
9
9
  var useWindowScroll = u.statefulStream(false);
10
10
  var customScrollParent = u.statefulStream(undefined);
11
11
  u.connect(u.pipe(u.combineLatest(windowScrollContainerState, windowViewportRect), u.map(function (_a) {
12
- var _b = __read(_a, 2), _c = __read(_b[0], 2), windowScrollTop = _c[0], scrollHeight = _c[1], offsetTop = _b[1].offsetTop;
13
- return [Math.max(0, windowScrollTop - offsetTop), scrollHeight];
12
+ var _b = __read(_a, 2), _c = _b[0], viewportHeight = _c.viewportHeight, windowScrollTop = _c.scrollTop, scrollHeight = _c.scrollHeight, offsetTop = _b[1].offsetTop;
13
+ return {
14
+ scrollTop: Math.max(0, windowScrollTop - offsetTop),
15
+ scrollHeight: scrollHeight,
16
+ viewportHeight: viewportHeight,
17
+ };
14
18
  })), scrollContainerState);
15
19
  u.connect(u.pipe(scrollTo, u.withLatestFrom(windowViewportRect), u.map(function (_a) {
16
20
  var _b = __read(_a, 2), scrollTo = _b[0], offsetTop = _b[1].offsetTop;
@@ -1,5 +1,4 @@
1
1
  import { useRef } from 'react';
2
- import { fixWebKitTransitionStyle } from '../../../foundation';
3
2
  /**
4
3
  * scroll into current highlight index
5
4
  */
@@ -105,7 +104,7 @@ export function useHighlightScroll(_a) {
105
104
  export function modifyVlScrollerStyle(scrollElm, position) {
106
105
  if (position === void 0) { position = 'absolute'; }
107
106
  if (scrollElm) {
108
- scrollElm.style.transition = fixWebKitTransitionStyle;
107
+ scrollElm.style.transition = 'all 1ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
109
108
  if (position) {
110
109
  var viewPortElm = scrollElm.firstChild;
111
110
  if (viewPortElm) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.10.0",
3
+ "version": "2.12.1",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",
@@ -27,7 +27,7 @@
27
27
  "focus-visible": "^5.1.0",
28
28
  "lodash": "^4.17.21",
29
29
  "react-beautiful-dnd": "^13.0.0",
30
- "react-virtuoso": "^2.8.3",
30
+ "react-virtuoso": "^2.10.1",
31
31
  "resize-observer-polyfill": "^1.5.1",
32
32
  "typeface-lato": "^0.0.75",
33
33
  "type-fest": "^2.12.2",