@atlaskit/navigation-system 5.38.1 → 5.39.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,18 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 5.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c987f6814195b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c987f6814195b) -
8
+ Fixes a bug where the panel splitter would not be resizable when some browser extensions were
9
+ installed. This change was previousuly behind the feature flag
10
+ `platform-dst-panel-splitter-drag-start-client-x`, which has now been cleaned up.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 5.38.1
4
17
 
5
18
  ### Patch Changes
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getWidthFromDragLocation = exports.getPixelWidth = void 0;
7
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
7
  /**
9
- * ⚠️ Note: We are not using the location.initial.input client locations because some browser extensions
10
- * can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
8
+ * ⚠️ Note: We are using the initial client location captured from the mousedown event, not from the dragstart event.
9
+ * Some browser extensions can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
11
10
  */
12
11
  var getWidthFromDragLocation = exports.getWidthFromDragLocation = function getWidthFromDragLocation(_ref) {
13
12
  var initialWidth = _ref.initialWidth,
@@ -15,7 +14,7 @@ var getWidthFromDragLocation = exports.getWidthFromDragLocation = function getWi
15
14
  initialClientX = _ref.initialClientX,
16
15
  direction = _ref.direction,
17
16
  position = _ref.position;
18
- var diffX = location.current.input.clientX - ((0, _platformFeatureFlags.fg)('platform-dst-panel-splitter-drag-start-client-x') ? initialClientX : location.initial.input.clientX);
17
+ var diffX = location.current.input.clientX - initialClientX;
19
18
 
20
19
  // Resize line is positioned at the inline-end (right) of the element.
21
20
  // If the direction is left-to-right, the width will increase when the mouse is moved to the right, and vice versa.
@@ -19,7 +19,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
19
19
  var _bindEventListener = require("bind-event-listener");
20
20
  var _reactDom = require("react-dom");
21
21
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
22
- var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
23
22
  var _useId = require("@atlaskit/ds-lib/use-id");
24
23
  var _useStableRef = _interopRequireDefault(require("@atlaskit/ds-lib/use-stable-ref"));
25
24
  var _openLayerObserver = require("@atlaskit/layering/experimental/open-layer-observer");
@@ -210,12 +209,12 @@ var PortaledPanelSplitter = function PortaledPanelSplitter(_ref3) {
210
209
  * I also tried only binding an event listener inside pragmatic-drag-and-drop's `onDragStart`, which seemd to work
211
210
  * but did not feel as robust, and might have timing issues as it happens slightly later.
212
211
  */
213
- (0, _platformFeatureFlags.fg)('platform-dst-panel-splitter-drag-start-client-x') ? (0, _bindEventListener.bind)(splitter, {
212
+ (0, _bindEventListener.bind)(splitter, {
214
213
  type: 'mousedown',
215
214
  listener: function listener(event) {
216
215
  initialClientXRef.current = event.clientX;
217
216
  }
218
- }) : _noop.default, (0, _adapter.draggable)({
217
+ }), (0, _adapter.draggable)({
219
218
  element: splitter,
220
219
  onGenerateDragPreview: function onGenerateDragPreview(_ref4) {
221
220
  var nativeSetDragImage = _ref4.nativeSetDragImage;
@@ -272,9 +271,7 @@ var PortaledPanelSplitter = function PortaledPanelSplitter(_ref3) {
272
271
  initialWidth = _source$data.initialWidth,
273
272
  resizeBounds = _source$data.resizeBounds,
274
273
  direction = _source$data.direction;
275
- if ((0, _platformFeatureFlags.fg)('platform-dst-panel-splitter-drag-start-client-x')) {
276
- (0, _tinyInvariant.default)(initialClientXRef.current !== null, 'initialClientX must be set');
277
- }
274
+ (0, _tinyInvariant.default)(initialClientXRef.current !== null, 'initialClientX must be set');
278
275
 
279
276
  /**
280
277
  * How wide the element would be if there were no width constraints,
@@ -1,7 +1,6 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  /**
3
- * ⚠️ Note: We are not using the location.initial.input client locations because some browser extensions
4
- * can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
2
+ * ⚠️ Note: We are using the initial client location captured from the mousedown event, not from the dragstart event.
3
+ * Some browser extensions can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
5
4
  */
6
5
  export const getWidthFromDragLocation = ({
7
6
  initialWidth,
@@ -10,7 +9,7 @@ export const getWidthFromDragLocation = ({
10
9
  direction,
11
10
  position
12
11
  }) => {
13
- const diffX = location.current.input.clientX - (fg('platform-dst-panel-splitter-drag-start-client-x') ? initialClientX : location.initial.input.clientX);
12
+ const diffX = location.current.input.clientX - initialClientX;
14
13
 
15
14
  // Resize line is positioned at the inline-end (right) of the element.
16
15
  // If the direction is left-to-right, the width will increase when the mouse is moved to the right, and vice versa.
@@ -7,7 +7,6 @@ import { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useSta
7
7
  import { bind } from 'bind-event-listener';
8
8
  import { createPortal } from 'react-dom';
9
9
  import invariant from 'tiny-invariant';
10
- import noop from '@atlaskit/ds-lib/noop';
11
10
  import { useId } from '@atlaskit/ds-lib/use-id';
12
11
  import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
13
12
  import { useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
@@ -193,12 +192,12 @@ const PortaledPanelSplitter = ({
193
192
  * I also tried only binding an event listener inside pragmatic-drag-and-drop's `onDragStart`, which seemd to work
194
193
  * but did not feel as robust, and might have timing issues as it happens slightly later.
195
194
  */
196
- fg('platform-dst-panel-splitter-drag-start-client-x') ? bind(splitter, {
195
+ bind(splitter, {
197
196
  type: 'mousedown',
198
197
  listener: event => {
199
198
  initialClientXRef.current = event.clientX;
200
199
  }
201
- }) : noop, draggable({
200
+ }), draggable({
202
201
  element: splitter,
203
202
  onGenerateDragPreview: ({
204
203
  nativeSetDragImage
@@ -259,9 +258,7 @@ const PortaledPanelSplitter = ({
259
258
  resizeBounds,
260
259
  direction
261
260
  } = source.data;
262
- if (fg('platform-dst-panel-splitter-drag-start-client-x')) {
263
- invariant(initialClientXRef.current !== null, 'initialClientX must be set');
264
- }
261
+ invariant(initialClientXRef.current !== null, 'initialClientX must be set');
265
262
 
266
263
  /**
267
264
  * How wide the element would be if there were no width constraints,
@@ -1,7 +1,6 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  /**
3
- * ⚠️ Note: We are not using the location.initial.input client locations because some browser extensions
4
- * can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
2
+ * ⚠️ Note: We are using the initial client location captured from the mousedown event, not from the dragstart event.
3
+ * Some browser extensions can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
5
4
  */
6
5
  export var getWidthFromDragLocation = function getWidthFromDragLocation(_ref) {
7
6
  var initialWidth = _ref.initialWidth,
@@ -9,7 +8,7 @@ export var getWidthFromDragLocation = function getWidthFromDragLocation(_ref) {
9
8
  initialClientX = _ref.initialClientX,
10
9
  direction = _ref.direction,
11
10
  position = _ref.position;
12
- var diffX = location.current.input.clientX - (fg('platform-dst-panel-splitter-drag-start-client-x') ? initialClientX : location.initial.input.clientX);
11
+ var diffX = location.current.input.clientX - initialClientX;
13
12
 
14
13
  // Resize line is positioned at the inline-end (right) of the element.
15
14
  // If the direction is left-to-right, the width will increase when the mouse is moved to the right, and vice versa.
@@ -13,7 +13,6 @@ import { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useSta
13
13
  import { bind } from 'bind-event-listener';
14
14
  import { createPortal } from 'react-dom';
15
15
  import invariant from 'tiny-invariant';
16
- import noop from '@atlaskit/ds-lib/noop';
17
16
  import { useId } from '@atlaskit/ds-lib/use-id';
18
17
  import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
19
18
  import { useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
@@ -200,12 +199,12 @@ var PortaledPanelSplitter = function PortaledPanelSplitter(_ref3) {
200
199
  * I also tried only binding an event listener inside pragmatic-drag-and-drop's `onDragStart`, which seemd to work
201
200
  * but did not feel as robust, and might have timing issues as it happens slightly later.
202
201
  */
203
- fg('platform-dst-panel-splitter-drag-start-client-x') ? bind(splitter, {
202
+ bind(splitter, {
204
203
  type: 'mousedown',
205
204
  listener: function listener(event) {
206
205
  initialClientXRef.current = event.clientX;
207
206
  }
208
- }) : noop, draggable({
207
+ }), draggable({
209
208
  element: splitter,
210
209
  onGenerateDragPreview: function onGenerateDragPreview(_ref4) {
211
210
  var nativeSetDragImage = _ref4.nativeSetDragImage;
@@ -262,9 +261,7 @@ var PortaledPanelSplitter = function PortaledPanelSplitter(_ref3) {
262
261
  initialWidth = _source$data.initialWidth,
263
262
  resizeBounds = _source$data.resizeBounds,
264
263
  direction = _source$data.direction;
265
- if (fg('platform-dst-panel-splitter-drag-start-client-x')) {
266
- invariant(initialClientXRef.current !== null, 'initialClientX must be set');
267
- }
264
+ invariant(initialClientXRef.current !== null, 'initialClientX must be set');
268
265
 
269
266
  /**
270
267
  * How wide the element would be if there were no width constraints,
@@ -1,7 +1,7 @@
1
1
  import type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';
2
2
  /**
3
- * ⚠️ Note: We are not using the location.initial.input client locations because some browser extensions
4
- * can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
3
+ * ⚠️ Note: We are using the initial client location captured from the mousedown event, not from the dragstart event.
4
+ * Some browser extensions can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
5
5
  */
6
6
  export declare const getWidthFromDragLocation: ({ initialWidth, location, initialClientX, direction, position, }: {
7
7
  initialWidth: number;
@@ -1,7 +1,7 @@
1
1
  import type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';
2
2
  /**
3
- * ⚠️ Note: We are not using the location.initial.input client locations because some browser extensions
4
- * can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
3
+ * ⚠️ Note: We are using the initial client location captured from the mousedown event, not from the dragstart event.
4
+ * Some browser extensions can cause the client locations (e.g. clientX) in the `dragstart` event to incorrectly return 0.
5
5
  */
6
6
  export declare const getWidthFromDragLocation: ({ initialWidth, location, initialClientX, direction, position, }: {
7
7
  initialWidth: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "5.38.1",
3
+ "version": "5.39.0",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "author": "Atlassian Pty Ltd",
@@ -189,9 +189,6 @@
189
189
  },
190
190
  "platform_dst_nav4_flyout_menu_slots_close_button": {
191
191
  "type": "boolean"
192
- },
193
- "platform-dst-panel-splitter-drag-start-client-x": {
194
- "type": "boolean"
195
192
  }
196
193
  },
197
194
  "homepage": "https://atlassian.design/components/navigation-system"