@atlaskit/page-layout 3.0.0 → 3.1.0

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,11 @@
1
1
  # @atlaskit/page-layout
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#81736](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81736) [`5ce631eec537`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ce631eec537) - Added `UNSAFE_useSetLeftSidebarState` to support an internal redesign. `UNSAFE_useSetLeftSidebarState` returns noop and will be removed in the next major release.
8
+
3
9
  ## 3.0.0
4
10
 
5
11
  ### Major Changes
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ "use strict";
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "SkipLinksController", {
22
22
  return _skipLinkController.SkipLinksController;
23
23
  }
24
24
  });
25
+ Object.defineProperty(exports, "UNSAFE_useSetLeftSidebarState", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _sidebarResizeContext.UNSAFE_useSetLeftSidebarState;
29
+ }
30
+ });
25
31
  Object.defineProperty(exports, "publishGridState", {
26
32
  enumerable: true,
27
33
  get: function get() {
@@ -4,11 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.usePageLayoutResize = exports.useLeftSidebarFlyoutLock = exports.SidebarResizeContext = void 0;
7
+ exports.usePageLayoutResize = exports.useLeftSidebarFlyoutLock = exports.UNSAFE_useSetLeftSidebarState = exports.SidebarResizeContext = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = require("react");
11
11
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _excluded = ["setLeftSidebarState"];
13
14
  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; }
14
15
  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) { (0, _defineProperty2.default)(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; }
@@ -21,6 +22,7 @@ var leftSidebarState = {
21
22
  flyoutLockCount: 0,
22
23
  isFixed: true
23
24
  };
25
+
24
26
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
25
27
  var SidebarResizeContext = exports.SidebarResizeContext = /*#__PURE__*/(0, _react.createContext)({
26
28
  isLeftSidebarCollapsed: false,
@@ -71,4 +73,13 @@ var useLeftSidebarFlyoutLock = exports.useLeftSidebarFlyoutLock = function useLe
71
73
  });
72
74
  };
73
75
  }, [setLeftSidebarState]);
76
+ };
77
+
78
+ /**
79
+ * @deprecated Returns noop. Added to support an internal redesign, `UNSAFE_useSetLeftSidebarState` will be removed in the next major release.
80
+ */
81
+ var UNSAFE_useSetLeftSidebarState = exports.UNSAFE_useSetLeftSidebarState = function UNSAFE_useSetLeftSidebarState() {
82
+ var _useContext3 = (0, _react.useContext)(SidebarResizeContext),
83
+ setLeftSidebarState = _useContext3.setLeftSidebarState;
84
+ return (0, _platformFeatureFlags.getBooleanFF)('platform.atlassian.griffin-navigation-redesign') ? setLeftSidebarState : _noop.default;
74
85
  };
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ "use strict";
package/dist/cjs/index.js CHANGED
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "TopNavigation", {
99
99
  return _components.TopNavigation;
100
100
  }
101
101
  });
102
+ Object.defineProperty(exports, "UNSAFE_useSetLeftSidebarState", {
103
+ enumerable: true,
104
+ get: function get() {
105
+ return _controllers.UNSAFE_useSetLeftSidebarState;
106
+ }
107
+ });
102
108
  Object.defineProperty(exports, "useCustomSkipLink", {
103
109
  enumerable: true,
104
110
  get: function get() {
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +1,5 @@
1
1
  export { default as publishGridState } from './use-page-layout-grid';
2
- export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock } from './sidebar-resize-context';
2
+ export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState } from './sidebar-resize-context';
3
3
  export { SidebarResizeController } from './sidebar-resize-controller';
4
4
  export { useSkipLinks, useSkipLink } from './skip-link-context';
5
5
  export { SkipLinksController } from './skip-link-controller';
@@ -1,5 +1,6 @@
1
1
  import { createContext, useContext, useEffect } from 'react';
2
2
  import noop from '@atlaskit/ds-lib/noop';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  const leftSidebarState = {
4
5
  isFlyoutOpen: false,
5
6
  isResizing: false,
@@ -9,6 +10,7 @@ const leftSidebarState = {
9
10
  flyoutLockCount: 0,
10
11
  isFixed: true
11
12
  };
13
+
12
14
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
13
15
  export const SidebarResizeContext = /*#__PURE__*/createContext({
14
16
  isLeftSidebarCollapsed: false,
@@ -59,4 +61,14 @@ export const useLeftSidebarFlyoutLock = () => {
59
61
  }));
60
62
  };
61
63
  }, [setLeftSidebarState]);
64
+ };
65
+
66
+ /**
67
+ * @deprecated Returns noop. Added to support an internal redesign, `UNSAFE_useSetLeftSidebarState` will be removed in the next major release.
68
+ */
69
+ export const UNSAFE_useSetLeftSidebarState = () => {
70
+ const {
71
+ setLeftSidebarState
72
+ } = useContext(SidebarResizeContext);
73
+ return getBooleanFF('platform.atlassian.griffin-navigation-redesign') ? setLeftSidebarState : noop;
62
74
  };
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +1,3 @@
1
1
  export { PageLayout, Main, Content, RightSidebar, LeftSidebar, LeftSidebarWithoutResize, RightPanel, LeftPanel, Banner, TopNavigation, useCustomSkipLink } from './components';
2
2
  export { LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, BANNER_HEIGHT, TOP_NAVIGATION_HEIGHT, LEFT_SIDEBAR_WIDTH, RIGHT_SIDEBAR_WIDTH } from './common/constants';
3
- export { usePageLayoutResize, useLeftSidebarFlyoutLock } from './controllers';
3
+ export { usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState } from './controllers';
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +1,5 @@
1
1
  export { default as publishGridState } from './use-page-layout-grid';
2
- export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock } from './sidebar-resize-context';
2
+ export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState } from './sidebar-resize-context';
3
3
  export { SidebarResizeController } from './sidebar-resize-controller';
4
4
  export { useSkipLinks, useSkipLink } from './skip-link-context';
5
5
  export { SkipLinksController } from './skip-link-controller';
@@ -5,6 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
5
5
  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; }
6
6
  import { createContext, useContext, useEffect } from 'react';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
9
  var leftSidebarState = {
9
10
  isFlyoutOpen: false,
10
11
  isResizing: false,
@@ -14,6 +15,7 @@ var leftSidebarState = {
14
15
  flyoutLockCount: 0,
15
16
  isFixed: true
16
17
  };
18
+
17
19
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
18
20
  export var SidebarResizeContext = /*#__PURE__*/createContext({
19
21
  isLeftSidebarCollapsed: false,
@@ -64,4 +66,13 @@ export var useLeftSidebarFlyoutLock = function useLeftSidebarFlyoutLock() {
64
66
  });
65
67
  };
66
68
  }, [setLeftSidebarState]);
69
+ };
70
+
71
+ /**
72
+ * @deprecated Returns noop. Added to support an internal redesign, `UNSAFE_useSetLeftSidebarState` will be removed in the next major release.
73
+ */
74
+ export var UNSAFE_useSetLeftSidebarState = function UNSAFE_useSetLeftSidebarState() {
75
+ var _useContext3 = useContext(SidebarResizeContext),
76
+ setLeftSidebarState = _useContext3.setLeftSidebarState;
77
+ return getBooleanFF('platform.atlassian.griffin-navigation-redesign') ? setLeftSidebarState : noop;
67
78
  };
@@ -1 +0,0 @@
1
- export {};
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { PageLayout, Main, Content, RightSidebar, LeftSidebar, LeftSidebarWithoutResize, RightPanel, LeftPanel, Banner, TopNavigation, useCustomSkipLink } from './components';
2
2
  export { LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, BANNER_HEIGHT, TOP_NAVIGATION_HEIGHT, LEFT_SIDEBAR_WIDTH, RIGHT_SIDEBAR_WIDTH } from './common/constants';
3
- export { usePageLayoutResize, useLeftSidebarFlyoutLock } from './controllers';
3
+ export { usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState } from './controllers';
@@ -1,6 +1,6 @@
1
1
  export type { SkipLinkData } from './types';
2
2
  export { default as publishGridState } from './use-page-layout-grid';
3
- export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, } from './sidebar-resize-context';
3
+ export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState, } from './sidebar-resize-context';
4
4
  export { SidebarResizeController } from './sidebar-resize-controller';
5
5
  export { useSkipLinks, useSkipLink } from './skip-link-context';
6
6
  export { SkipLinksController } from './skip-link-controller';
@@ -50,3 +50,7 @@ export declare const usePageLayoutResize: () => {
50
50
  * as long as the popup is open.
51
51
  */
52
52
  export declare const useLeftSidebarFlyoutLock: () => void;
53
+ /**
54
+ * @deprecated Returns noop. Added to support an internal redesign, `UNSAFE_useSetLeftSidebarState` will be removed in the next major release.
55
+ */
56
+ export declare const UNSAFE_useSetLeftSidebarState: () => SidebarResizeContextValue['setLeftSidebarState'];
@@ -1,4 +1,4 @@
1
1
  export { PageLayout, Main, Content, RightSidebar, LeftSidebar, LeftSidebarWithoutResize, RightPanel, LeftPanel, Banner, TopNavigation, useCustomSkipLink, } from './components';
2
2
  export { LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, BANNER_HEIGHT, TOP_NAVIGATION_HEIGHT, LEFT_SIDEBAR_WIDTH, RIGHT_SIDEBAR_WIDTH, } from './common/constants';
3
- export { usePageLayoutResize, useLeftSidebarFlyoutLock } from './controllers';
3
+ export { usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState, } from './controllers';
4
4
  export type { SlotHeightProps, SlotWidthProps, Dimensions, LeftSidebarState, } from './common/types';
@@ -1,6 +1,6 @@
1
1
  export type { SkipLinkData } from './types';
2
2
  export { default as publishGridState } from './use-page-layout-grid';
3
- export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, } from './sidebar-resize-context';
3
+ export { SidebarResizeContext, usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState, } from './sidebar-resize-context';
4
4
  export { SidebarResizeController } from './sidebar-resize-controller';
5
5
  export { useSkipLinks, useSkipLink } from './skip-link-context';
6
6
  export { SkipLinksController } from './skip-link-controller';
@@ -50,3 +50,7 @@ export declare const usePageLayoutResize: () => {
50
50
  * as long as the popup is open.
51
51
  */
52
52
  export declare const useLeftSidebarFlyoutLock: () => void;
53
+ /**
54
+ * @deprecated Returns noop. Added to support an internal redesign, `UNSAFE_useSetLeftSidebarState` will be removed in the next major release.
55
+ */
56
+ export declare const UNSAFE_useSetLeftSidebarState: () => SidebarResizeContextValue['setLeftSidebarState'];
@@ -1,4 +1,4 @@
1
1
  export { PageLayout, Main, Content, RightSidebar, LeftSidebar, LeftSidebarWithoutResize, RightPanel, LeftPanel, Banner, TopNavigation, useCustomSkipLink, } from './components';
2
2
  export { LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, BANNER_HEIGHT, TOP_NAVIGATION_HEIGHT, LEFT_SIDEBAR_WIDTH, RIGHT_SIDEBAR_WIDTH, } from './common/constants';
3
- export { usePageLayoutResize, useLeftSidebarFlyoutLock } from './controllers';
3
+ export { usePageLayoutResize, useLeftSidebarFlyoutLock, UNSAFE_useSetLeftSidebarState, } from './controllers';
4
4
  export type { SlotHeightProps, SlotWidthProps, Dimensions, LeftSidebarState, } from './common/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/page-layout",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A collection of components which let you compose an application's page layout.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/icon": "^22.1.0",
43
43
  "@atlaskit/motion": "^1.5.0",
44
44
  "@atlaskit/platform-feature-flags": "^0.2.0",
45
- "@atlaskit/primitives": "^4.0.0",
45
+ "@atlaskit/primitives": "^4.1.0",
46
46
  "@atlaskit/theme": "^12.6.0",
47
47
  "@atlaskit/tokens": "^1.41.0",
48
48
  "@babel/runtime": "^7.0.0",
@@ -59,7 +59,7 @@
59
59
  "@af/integration-testing": "*",
60
60
  "@atlaskit/atlassian-navigation": "^3.3.0",
61
61
  "@atlaskit/atlassian-notifications": "^0.4.0",
62
- "@atlaskit/drawer": "^7.6.0",
62
+ "@atlaskit/drawer": "^7.7.0",
63
63
  "@atlaskit/logo": "^13.15.0",
64
64
  "@atlaskit/menu": "^2.1.0",
65
65
  "@atlaskit/notification-indicator": "^9.2.0",
@@ -115,6 +115,9 @@
115
115
  "platform-feature-flags": {
116
116
  "platform.design-system-team.page-layout-resize-button-fix_u0qxv": {
117
117
  "type": "boolean"
118
+ },
119
+ "platform.atlassian.griffin-navigation-redesign": {
120
+ "type": "boolean"
118
121
  }
119
122
  }
120
123
  }