@atlaskit/atlassian-navigation 2.1.3 → 2.1.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 2.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3622df604ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3622df604ee) - Fixes bug where navigation items cannot be added after intial render if the initial item array was empty
8
+
9
+ ## 2.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
14
+ - Updated dependencies
15
+
16
+ ## 2.1.4
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 2.1.3
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Atlassian Navigation
1
+ # Atlassian navigation
2
2
 
3
- The new top navigation experience used in Atlassian products.
3
+ A horizontal navigation component for Atlassian products.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ yarn add @atlaskit/atlassian-navigation
10
10
 
11
11
  ## Usage
12
12
 
13
- Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/navigation/atlassian-navigation).
13
+ Detailed docs and example usage can be found [here](https://atlassian.design/components/atlassian-navigation).
14
14
 
15
15
  To add side navigation, use [@atlaskit/side-navigation](https://atlaskit.atlassian.com/packages/navigation/side-navigation)
16
16
  To control the layout of these navigation elements and add expand/collapse functionality to `side-navigation`, use [@atlaskit/page-layout](https://atlaskit.atlassian.com/packages/design-system/page-layout).
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.NavigationSkeleton = void 0;
6
+ exports.default = exports.NavigationSkeleton = void 0;
7
7
 
8
8
  var _core = require("@emotion/core");
9
9
 
@@ -120,4 +120,6 @@ var NavigationSkeleton = function NavigationSkeleton(_ref) {
120
120
  }), (0, _core.jsx)(_skeleton4.ProfileSkeleton, null))));
121
121
  };
122
122
 
123
- exports.NavigationSkeleton = NavigationSkeleton;
123
+ exports.NavigationSkeleton = NavigationSkeleton;
124
+ var _default = NavigationSkeleton;
125
+ exports.default = _default;
@@ -93,7 +93,7 @@ var useOverflowController = function useOverflowController(nodes) {
93
93
 
94
94
  var throttleSetWidth = (0, _react.useCallback)((0, _throttle.default)(setWidth, THROTTLE_INTERVAL), [setWidth]);
95
95
  (0, _react.useEffect)(function () {
96
- var lastItemWidth = itemsWidths[itemsLimit];
96
+ var lastItemWidth = itemsWidths[itemsLimit] || 0;
97
97
  var wasJustLimited = lastItemWidth < 0;
98
98
  var currentHash = calculateHash(width, itemsLimit);
99
99
 
@@ -134,7 +134,7 @@ var useOverflowController = function useOverflowController(nodes) {
134
134
  return;
135
135
  }
136
136
 
137
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
137
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
138
138
  // If we have enough room to accomodate next item width we increase the limit
139
139
  // unless it has been recently removed
140
140
  var _nextHash = calculateHash(width, itemsLimit + 1);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.3",
3
+ "version": "2.1.6",
4
4
  "sideEffects": false
5
5
  }
@@ -95,4 +95,5 @@ export const NavigationSkeleton = ({
95
95
  marginRight: gridSize / 2,
96
96
  size: gridSize * 3.25
97
97
  })), jsx(ProfileSkeleton, null))));
98
- };
98
+ };
99
+ export default NavigationSkeleton;
@@ -51,7 +51,7 @@ export const useOverflowController = nodes => {
51
51
 
52
52
  const throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
53
53
  useEffect(() => {
54
- const lastItemWidth = itemsWidths[itemsLimit];
54
+ const lastItemWidth = itemsWidths[itemsLimit] || 0;
55
55
  const wasJustLimited = lastItemWidth < 0;
56
56
  const currentHash = calculateHash(width, itemsLimit);
57
57
 
@@ -90,7 +90,7 @@ export const useOverflowController = nodes => {
90
90
  return;
91
91
  }
92
92
 
93
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
93
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
94
94
  // If we have enough room to accomodate next item width we increase the limit
95
95
  // unless it has been recently removed
96
96
  const nextHash = calculateHash(width, itemsLimit + 1);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.3",
3
+ "version": "2.1.6",
4
4
  "sideEffects": false
5
5
  }
@@ -101,4 +101,5 @@ export var NavigationSkeleton = function NavigationSkeleton(_ref) {
101
101
  size: gridSize * 3.25
102
102
  });
103
103
  }), jsx(ProfileSkeleton, null))));
104
- };
104
+ };
105
+ export default NavigationSkeleton;
@@ -68,7 +68,7 @@ export var useOverflowController = function useOverflowController(nodes) {
68
68
 
69
69
  var throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
70
70
  useEffect(function () {
71
- var lastItemWidth = itemsWidths[itemsLimit];
71
+ var lastItemWidth = itemsWidths[itemsLimit] || 0;
72
72
  var wasJustLimited = lastItemWidth < 0;
73
73
  var currentHash = calculateHash(width, itemsLimit);
74
74
 
@@ -109,7 +109,7 @@ export var useOverflowController = function useOverflowController(nodes) {
109
109
  return;
110
110
  }
111
111
 
112
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
112
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
113
113
  // If we have enough room to accomodate next item width we increase the limit
114
114
  // unless it has been recently removed
115
115
  var _nextHash = calculateHash(width, itemsLimit + 1);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.3",
3
+ "version": "2.1.6",
4
4
  "sideEffects": false
5
5
  }