@atlaskit/side-nav-items 1.11.0 → 1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/side-nav-items
2
2
 
3
+ ## 1.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a7ccccca79cb9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a7ccccca79cb9) -
8
+ Clean up feature gate navx-4169-improve-gsn-code
9
+
10
+ ## 1.12.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`f48c03e011b92`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f48c03e011b92) -
15
+ Updated usage of `SideNavContent` to `SideNavBody` due to rename in `@atlaskit/navigation-system`.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 1.11.0
4
22
 
5
23
  ### Minor Changes
@@ -1,23 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.LazyDragHandle = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
8
+ exports.LazyDragHandle = LazyDragHandle;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
- var LazyDragHandleComponent = /*#__PURE__*/(0, _react.lazy)(function () {
14
- return Promise.resolve().then(function () {
15
- return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
16
- './drag-handle'));
17
- });
18
- });
19
- var LazyDragHandle = exports.LazyDragHandle = (0, _platformFeatureFlagsReact.componentWithFG)('navx-4169-improve-gsn-code', LazyDragHandleNEW, LazyDragHandleComponent);
20
-
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
21
12
  /**
22
13
  * A wrapper around `React.lazy` that defers rendering until after the component has mounted.
23
14
  *
@@ -34,7 +25,7 @@ var LazyDragHandle = exports.LazyDragHandle = (0, _platformFeatureFlagsReact.com
34
25
  * By deferring to after mount, both server and initial client render agree on `null`,
35
26
  * and the lazy import + Suspense only kicks in after hydration is complete.
36
27
  */
37
- function LazyDragHandleNEW() {
28
+ function LazyDragHandle() {
38
29
  var _useState = (0, _react.useState)(null),
39
30
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
40
31
  Component = _useState2[0],
@@ -52,4 +43,10 @@ function LazyDragHandleNEW() {
52
43
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
53
44
  fallback: null
54
45
  }, /*#__PURE__*/_react.default.createElement(Component, null));
55
- }
46
+ }
47
+ var LazyDragHandleComponent = /*#__PURE__*/(0, _react.lazy)(function () {
48
+ return Promise.resolve().then(function () {
49
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
50
+ './drag-handle'));
51
+ });
52
+ });
@@ -303,9 +303,7 @@ var MenuItemBaseNoRef = function MenuItemBaseNoRef(_ref2, forwardedRef) {
303
303
  size: "small",
304
304
  maxLines: 1,
305
305
  ref: descriptionRef
306
- }, description)), hasDragIndicator ? (0, _platformFeatureFlags.fg)('navx-4169-improve-gsn-code') ? /*#__PURE__*/_react.default.createElement(_lazyDragHandle.LazyDragHandle, null) : /*#__PURE__*/_react.default.createElement(_react.Suspense, {
307
- fallback: null
308
- }, /*#__PURE__*/_react.default.createElement(_lazyDragHandle.LazyDragHandle, null)) : null, dropIndicator);
306
+ }, description)), hasDragIndicator ? /*#__PURE__*/_react.default.createElement(_lazyDragHandle.LazyDragHandle, null) : null, dropIndicator);
309
307
 
310
308
  /**
311
309
  * If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
@@ -1,10 +1,4 @@
1
1
  import React, { lazy, Suspense, useEffect, useState } from 'react';
2
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
3
- const LazyDragHandleComponent = /*#__PURE__*/lazy(() => {
4
- return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
5
- './drag-handle');
6
- });
7
- export const LazyDragHandle = componentWithFG('navx-4169-improve-gsn-code', LazyDragHandleNEW, LazyDragHandleComponent);
8
2
 
9
3
  /**
10
4
  * A wrapper around `React.lazy` that defers rendering until after the component has mounted.
@@ -22,7 +16,7 @@ export const LazyDragHandle = componentWithFG('navx-4169-improve-gsn-code', Lazy
22
16
  * By deferring to after mount, both server and initial client render agree on `null`,
23
17
  * and the lazy import + Suspense only kicks in after hydration is complete.
24
18
  */
25
- function LazyDragHandleNEW() {
19
+ export function LazyDragHandle() {
26
20
  const [Component, setComponent] = useState(null);
27
21
  useEffect(() => {
28
22
  // Using a function updater to store the component reference itself
@@ -35,4 +29,8 @@ function LazyDragHandleNEW() {
35
29
  return /*#__PURE__*/React.createElement(Suspense, {
36
30
  fallback: null
37
31
  }, /*#__PURE__*/React.createElement(Component, null));
38
- }
32
+ }
33
+ const LazyDragHandleComponent = /*#__PURE__*/lazy(() => {
34
+ return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
35
+ './drag-handle');
36
+ });
@@ -2,7 +2,7 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./menu-item.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React, { Suspense, useCallback, useRef } from 'react';
5
+ import React, { useCallback, useRef } from 'react';
6
6
  import { cx } from '@compiled/react';
7
7
  import { AvatarContext } from '@atlaskit/avatar';
8
8
  import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
@@ -293,9 +293,7 @@ const MenuItemBaseNoRef = ({
293
293
  size: "small",
294
294
  maxLines: 1,
295
295
  ref: descriptionRef
296
- }, description)), hasDragIndicator ? fg('navx-4169-improve-gsn-code') ? /*#__PURE__*/React.createElement(LazyDragHandle, null) : /*#__PURE__*/React.createElement(Suspense, {
297
- fallback: null
298
- }, /*#__PURE__*/React.createElement(LazyDragHandle, null)) : null, dropIndicator);
296
+ }, description)), hasDragIndicator ? /*#__PURE__*/React.createElement(LazyDragHandle, null) : null, dropIndicator);
299
297
 
300
298
  /**
301
299
  * If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
@@ -1,11 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { lazy, Suspense, useEffect, useState } from 'react';
3
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
4
- var LazyDragHandleComponent = /*#__PURE__*/lazy(function () {
5
- return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
6
- './drag-handle');
7
- });
8
- export var LazyDragHandle = componentWithFG('navx-4169-improve-gsn-code', LazyDragHandleNEW, LazyDragHandleComponent);
9
3
 
10
4
  /**
11
5
  * A wrapper around `React.lazy` that defers rendering until after the component has mounted.
@@ -23,7 +17,7 @@ export var LazyDragHandle = componentWithFG('navx-4169-improve-gsn-code', LazyDr
23
17
  * By deferring to after mount, both server and initial client render agree on `null`,
24
18
  * and the lazy import + Suspense only kicks in after hydration is complete.
25
19
  */
26
- function LazyDragHandleNEW() {
20
+ export function LazyDragHandle() {
27
21
  var _useState = useState(null),
28
22
  _useState2 = _slicedToArray(_useState, 2),
29
23
  Component = _useState2[0],
@@ -41,4 +35,8 @@ function LazyDragHandleNEW() {
41
35
  return /*#__PURE__*/React.createElement(Suspense, {
42
36
  fallback: null
43
37
  }, /*#__PURE__*/React.createElement(Component, null));
44
- }
38
+ }
39
+ var LazyDragHandleComponent = /*#__PURE__*/lazy(function () {
40
+ return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
41
+ './drag-handle');
42
+ });
@@ -5,7 +5,7 @@ import "./menu-item.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- import React, { Suspense, useCallback, useRef } from 'react';
8
+ import React, { useCallback, useRef } from 'react';
9
9
  import { cx } from '@compiled/react';
10
10
  import { AvatarContext } from '@atlaskit/avatar';
11
11
  import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
@@ -294,9 +294,7 @@ var MenuItemBaseNoRef = function MenuItemBaseNoRef(_ref2, forwardedRef) {
294
294
  size: "small",
295
295
  maxLines: 1,
296
296
  ref: descriptionRef
297
- }, description)), hasDragIndicator ? fg('navx-4169-improve-gsn-code') ? /*#__PURE__*/React.createElement(LazyDragHandle, null) : /*#__PURE__*/React.createElement(Suspense, {
298
- fallback: null
299
- }, /*#__PURE__*/React.createElement(LazyDragHandle, null)) : null, dropIndicator);
297
+ }, description)), hasDragIndicator ? /*#__PURE__*/React.createElement(LazyDragHandle, null) : null, dropIndicator);
300
298
 
301
299
  /**
302
300
  * If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
@@ -1,2 +1,18 @@
1
1
  import React from 'react';
2
- export declare const LazyDragHandle: React.FC<React.RefAttributes<unknown>>;
2
+ /**
3
+ * A wrapper around `React.lazy` that defers rendering until after the component has mounted.
4
+ *
5
+ * This avoids hydration errors because:
6
+ * - On the server: `Component` is `null`, so nothing is rendered.
7
+ * - On the first client render (hydration): `Component` is still `null`, matching the server HTML.
8
+ * - After mount: `useEffect` fires, sets the lazy component, and triggers a re-render
9
+ * that is scoped to this component only.
10
+ *
11
+ * This is preferable to using `<Suspense>` around `React.lazy` directly in the parent,
12
+ * because `<Suspense fallback={null}>` on the server renders nothing, but after hydration
13
+ * the lazy component will resolve and produce DOM that doesn't match the server HTML.
14
+ *
15
+ * By deferring to after mount, both server and initial client render agree on `null`,
16
+ * and the lazy import + Suspense only kicks in after hydration is complete.
17
+ */
18
+ export declare function LazyDragHandle(): React.JSX.Element | null;
@@ -1,2 +1,18 @@
1
1
  import React from 'react';
2
- export declare const LazyDragHandle: React.FC<React.RefAttributes<unknown>>;
2
+ /**
3
+ * A wrapper around `React.lazy` that defers rendering until after the component has mounted.
4
+ *
5
+ * This avoids hydration errors because:
6
+ * - On the server: `Component` is `null`, so nothing is rendered.
7
+ * - On the first client render (hydration): `Component` is still `null`, matching the server HTML.
8
+ * - After mount: `useEffect` fires, sets the lazy component, and triggers a re-render
9
+ * that is scoped to this component only.
10
+ *
11
+ * This is preferable to using `<Suspense>` around `React.lazy` directly in the parent,
12
+ * because `<Suspense fallback={null}>` on the server renders nothing, but after hydration
13
+ * the lazy component will resolve and produce DOM that doesn't match the server HTML.
14
+ *
15
+ * By deferring to after mount, both server and initial client render agree on `null`,
16
+ * and the lazy import + Suspense only kicks in after hydration is complete.
17
+ */
18
+ export declare function LazyDragHandle(): React.JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-nav-items",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "description": "Menu items and elements for the side nav area.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,21 +29,20 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/analytics-next": "^11.1.0",
33
- "@atlaskit/avatar": "^25.10.0",
32
+ "@atlaskit/analytics-next": "^11.2.0",
33
+ "@atlaskit/avatar": "^25.11.0",
34
34
  "@atlaskit/button": "^23.10.0",
35
35
  "@atlaskit/css": "^0.19.0",
36
36
  "@atlaskit/ds-lib": "^6.0.0",
37
37
  "@atlaskit/heading": "^5.3.0",
38
- "@atlaskit/icon": "^33.0.0",
38
+ "@atlaskit/icon": "^33.1.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
- "@atlaskit/platform-feature-flags-react": "^0.4.0",
41
40
  "@atlaskit/popup": "^4.14.0",
42
41
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
43
42
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
44
43
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
45
- "@atlaskit/primitives": "^18.0.0",
46
- "@atlaskit/tokens": "^11.1.0",
44
+ "@atlaskit/primitives": "^18.1.0",
45
+ "@atlaskit/tokens": "^11.4.0",
47
46
  "@atlaskit/tooltip": "^21.0.0",
48
47
  "@babel/runtime": "^7.0.0",
49
48
  "@compiled/react": "^0.20.0",
@@ -57,13 +56,13 @@
57
56
  "@af/accessibility-testing": "workspace:^",
58
57
  "@af/integration-testing": "workspace:^",
59
58
  "@af/visual-regression": "workspace:^",
60
- "@atlaskit/app-provider": "^4.1.0",
59
+ "@atlaskit/app-provider": "^4.2.0",
61
60
  "@atlaskit/lozenge": "^13.5.0",
62
- "@atlaskit/navigation-system": "^6.4.0",
61
+ "@atlaskit/navigation-system": "^7.1.0",
63
62
  "@atlaskit/ssr": "workspace:^",
64
63
  "@atlassian/a11y-jest-testing": "^0.10.0",
65
64
  "@atlassian/feature-flags-test-utils": "^1.0.0",
66
- "@atlassian/testing-library": "^0.4.0",
65
+ "@atlassian/testing-library": "^0.5.0",
67
66
  "@testing-library/react": "^16.3.0",
68
67
  "bind-event-listener": "^3.0.0",
69
68
  "react-dom": "^18.2.0"
@@ -109,9 +108,6 @@
109
108
  },
110
109
  "platform_dst_nav4_flyout_menu_slots_close_button": {
111
110
  "type": "boolean"
112
- },
113
- "navx-4169-improve-gsn-code": {
114
- "type": "boolean"
115
111
  }
116
112
  }
117
113
  }