@atlaskit/editor-plugin-block-controls 4.1.2 → 4.1.4

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,22 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 4.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c08b561ac933b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c08b561ac933b) -
8
+ [ux] Fixes a regression where isSelectedViaDragHandle state wasn't updated correctly.
9
+ - Updated dependencies
10
+
11
+ ## 4.1.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#193381](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193381)
16
+ [`468cb58f0615b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/468cb58f0615b) -
17
+ ENGHEALTH-32254 Add aria label to buttons for accessibility
18
+ - Updated dependencies
19
+
3
20
  ## 4.1.2
4
21
 
5
22
  ### Patch Changes
@@ -251,7 +251,8 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
251
251
  menuTriggerBy = currentState.menuTriggerBy,
252
252
  isPMDragging = currentState.isPMDragging,
253
253
  isShiftDown = currentState.isShiftDown,
254
- lastDragCancelled = currentState.lastDragCancelled;
254
+ lastDragCancelled = currentState.lastDragCancelled,
255
+ isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
255
256
  var isActiveNodeDeleted = false;
256
257
  var _getTrMetadata = (0, _transactions.getTrMetadata)(tr),
257
258
  from = _getTrMetadata.from,
@@ -513,7 +514,12 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
513
514
  } else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
514
515
  isMenuOpenNew = !isMenuOpen;
515
516
  }
516
- var isSelectedViaDragHandle = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
517
+ var isSelectedViaDragHandleNew;
518
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _expValEquals.expValEquals)('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
519
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
520
+ } else {
521
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
522
+ }
517
523
  return {
518
524
  decorations: decorations,
519
525
  activeNode: newActiveNode,
@@ -530,7 +536,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
530
536
  multiSelectDnD: multiSelectDnD,
531
537
  isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
532
538
  lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
533
- isSelectedViaDragHandle: isSelectedViaDragHandle
539
+ isSelectedViaDragHandle: isSelectedViaDragHandleNew
534
540
  };
535
541
  };
536
542
  var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, nodeViewPortalProviderAPI) {
@@ -27,6 +27,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
27
  var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
28
28
  var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
29
29
  var _primitives = require("@atlaskit/primitives");
30
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
30
31
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
31
32
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
32
33
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -896,7 +897,8 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
896
897
  onDrop: handleOnDrop,
897
898
  disabled: dragHandleDisabled,
898
899
  "data-editor-block-ctrl-drag-handle": true,
899
- "data-testid": "block-ctrl-drag-handle"
900
+ "data-testid": "block-ctrl-drag-handle",
901
+ "aria-label": (0, _expValEquals.expValEquals)('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? formatMessage(_messages.blockControlsMessages.dragToMove) : ''
900
902
  }, (0, _react2.jsx)(_primitives.Box, {
901
903
  xcss: iconWrapperStyles
902
904
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
@@ -250,7 +250,8 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
250
250
  menuTriggerBy,
251
251
  isPMDragging,
252
252
  isShiftDown,
253
- lastDragCancelled
253
+ lastDragCancelled,
254
+ isSelectedViaDragHandle
254
255
  } = currentState;
255
256
  let isActiveNodeDeleted = false;
256
257
  const {
@@ -513,7 +514,12 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
513
514
  } else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
514
515
  isMenuOpenNew = !isMenuOpen;
515
516
  }
516
- const isSelectedViaDragHandle = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
517
+ let isSelectedViaDragHandleNew;
518
+ if (editorExperiment('platform_editor_controls', 'variant1') && expValEquals('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
519
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
520
+ } else {
521
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
522
+ }
517
523
  return {
518
524
  decorations,
519
525
  activeNode: newActiveNode,
@@ -530,7 +536,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
530
536
  multiSelectDnD,
531
537
  isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
532
538
  lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
533
- isSelectedViaDragHandle
539
+ isSelectedViaDragHandle: isSelectedViaDragHandleNew
534
540
  };
535
541
  };
536
542
  export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
@@ -25,6 +25,7 @@ import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
25
25
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
26
26
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
27
27
  import { Box, xcss } from '@atlaskit/primitives';
28
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
28
29
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
29
30
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
30
31
  import Tooltip from '@atlaskit/tooltip';
@@ -887,7 +888,8 @@ export const DragHandle = ({
887
888
  onDrop: handleOnDrop,
888
889
  disabled: dragHandleDisabled,
889
890
  "data-editor-block-ctrl-drag-handle": true,
890
- "data-testid": "block-ctrl-drag-handle"
891
+ "data-testid": "block-ctrl-drag-handle",
892
+ "aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? formatMessage(blockControlsMessages.dragToMove) : ''
891
893
  }, jsx(Box, {
892
894
  xcss: iconWrapperStyles
893
895
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
@@ -244,7 +244,8 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
244
244
  menuTriggerBy = currentState.menuTriggerBy,
245
245
  isPMDragging = currentState.isPMDragging,
246
246
  isShiftDown = currentState.isShiftDown,
247
- lastDragCancelled = currentState.lastDragCancelled;
247
+ lastDragCancelled = currentState.lastDragCancelled,
248
+ isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
248
249
  var isActiveNodeDeleted = false;
249
250
  var _getTrMetadata = getTrMetadata(tr),
250
251
  from = _getTrMetadata.from,
@@ -506,7 +507,12 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
506
507
  } else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
507
508
  isMenuOpenNew = !isMenuOpen;
508
509
  }
509
- var isSelectedViaDragHandle = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
510
+ var isSelectedViaDragHandleNew;
511
+ if (editorExperiment('platform_editor_controls', 'variant1') && expValEquals('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
512
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
513
+ } else {
514
+ isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
515
+ }
510
516
  return {
511
517
  decorations: decorations,
512
518
  activeNode: newActiveNode,
@@ -523,7 +529,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
523
529
  multiSelectDnD: multiSelectDnD,
524
530
  isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
525
531
  lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
526
- isSelectedViaDragHandle: isSelectedViaDragHandle
532
+ isSelectedViaDragHandle: isSelectedViaDragHandleNew
527
533
  };
528
534
  };
529
535
  export { _apply as apply };
@@ -30,6 +30,7 @@ import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
30
30
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
31
31
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
32
32
  import { Box, xcss } from '@atlaskit/primitives';
33
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
33
34
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
34
35
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
35
36
  import Tooltip from '@atlaskit/tooltip';
@@ -893,7 +894,8 @@ export var DragHandle = function DragHandle(_ref) {
893
894
  onDrop: handleOnDrop,
894
895
  disabled: dragHandleDisabled,
895
896
  "data-editor-block-ctrl-drag-handle": true,
896
- "data-testid": "block-ctrl-drag-handle"
897
+ "data-testid": "block-ctrl-drag-handle",
898
+ "aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? formatMessage(blockControlsMessages.dragToMove) : ''
897
899
  }, jsx(Box, {
898
900
  xcss: iconWrapperStyles
899
901
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
@@ -28,6 +28,6 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
28
28
  multiSelectDnD: import("../blockControlsPluginType").MultiSelectDnD | undefined;
29
29
  isShiftDown: any;
30
30
  lastDragCancelled: any;
31
- isSelectedViaDragHandle: boolean;
31
+ isSelectedViaDragHandle: any;
32
32
  };
33
33
  export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
@@ -28,6 +28,6 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
28
28
  multiSelectDnD: import("../blockControlsPluginType").MultiSelectDnD | undefined;
29
29
  isShiftDown: any;
30
30
  lastDragCancelled: any;
31
- isSelectedViaDragHandle: boolean;
31
+ isSelectedViaDragHandle: any;
32
32
  };
33
33
  export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/editor-prosemirror": "7.0.0",
47
47
  "@atlaskit/editor-shared-styles": "^3.5.0",
48
48
  "@atlaskit/editor-tables": "^2.9.0",
49
- "@atlaskit/icon": "^27.7.0",
49
+ "@atlaskit/icon": "^27.8.0",
50
50
  "@atlaskit/link": "^3.2.0",
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
55
55
  "@atlaskit/primitives": "^14.11.0",
56
56
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.17.0",
57
+ "@atlaskit/tmp-editor-statsig": "^9.21.0",
58
58
  "@atlaskit/tokens": "^5.6.0",
59
59
  "@atlaskit/tooltip": "^20.4.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -66,7 +66,7 @@
66
66
  "uuid": "^3.1.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@atlaskit/editor-common": "^107.12.0",
69
+ "@atlaskit/editor-common": "^107.16.0",
70
70
  "react": "^18.2.0",
71
71
  "react-dom": "^18.2.0",
72
72
  "react-intl-next": "npm:react-intl@^5.18.1"