@atlaskit/editor-plugin-block-controls 11.4.7 → 11.5.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,22 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 11.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`71eaad00529a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/71eaad00529a1) -
14
+ Support multi-column layout column menu selections
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 11.4.7
4
21
 
5
22
  ### Patch Changes
@@ -466,6 +466,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
466
466
  }
467
467
  if (nodeType === 'layoutColumn' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true)) {
468
468
  tr.setMeta('toggleLayoutColumnMenu', {
469
+ anchorPos: startPos,
469
470
  isOpen: true
470
471
  });
471
472
  }
@@ -519,6 +520,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
519
520
  }
520
521
  if (nodeType === 'layoutColumn' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true)) {
521
522
  tr.setMeta('toggleLayoutColumnMenu', {
523
+ anchorPos: startPos,
522
524
  isOpen: true
523
525
  });
524
526
  }
@@ -895,12 +897,13 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
895
897
  }
896
898
  var mSelect = api === null || api === void 0 || (_api$blockControls$sh4 = api.blockControls.sharedState.currentState()) === null || _api$blockControls$sh4 === void 0 ? void 0 : _api$blockControls$sh4.multiSelectDnD;
897
899
  var $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? view.state.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : view.state.selection.$anchor;
898
- if (isShiftDown && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > _consts2.DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
900
+ var isLayoutColumnMenuEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true);
901
+ if (isShiftDown && !(isLayoutColumnMenuEnabled && isLayoutColumn) && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > _consts2.DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
899
902
  setDragHandleDisabled(true);
900
903
  } else {
901
904
  setDragHandleDisabled(false);
902
905
  }
903
- }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
906
+ }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isLayoutColumn, isShiftDown, isTopLevelNodeValue, view]);
904
907
  var dragHandleMessage = (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? formatMessage(_messages.blockControlsMessages.dragToMoveClickToOpen, {
905
908
  br: (0, _react2.jsx)("br", null)
906
909
  }) : formatMessage(_messages.blockControlsMessages.dragToMove);
@@ -441,6 +441,7 @@ export const DragHandle = ({
441
441
  }
442
442
  if (nodeType === 'layoutColumn' && expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true)) {
443
443
  tr.setMeta('toggleLayoutColumnMenu', {
444
+ anchorPos: startPos,
444
445
  isOpen: true
445
446
  });
446
447
  }
@@ -495,6 +496,7 @@ export const DragHandle = ({
495
496
  }
496
497
  if (nodeType === 'layoutColumn' && expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true)) {
497
498
  tr.setMeta('toggleLayoutColumnMenu', {
499
+ anchorPos: startPos,
498
500
  isOpen: true
499
501
  });
500
502
  }
@@ -877,12 +879,13 @@ export const DragHandle = ({
877
879
  }
878
880
  const mSelect = api === null || api === void 0 ? void 0 : (_api$blockControls$sh4 = api.blockControls.sharedState.currentState()) === null || _api$blockControls$sh4 === void 0 ? void 0 : _api$blockControls$sh4.multiSelectDnD;
879
881
  const $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? view.state.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : view.state.selection.$anchor;
880
- if (isShiftDown && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
882
+ const isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
883
+ if (isShiftDown && !(isLayoutColumnMenuEnabled && isLayoutColumn) && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
881
884
  setDragHandleDisabled(true);
882
885
  } else {
883
886
  setDragHandleDisabled(false);
884
887
  }
885
- }, [api === null || api === void 0 ? void 0 : (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
888
+ }, [api === null || api === void 0 ? void 0 : (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isLayoutColumn, isShiftDown, isTopLevelNodeValue, view]);
886
889
  const dragHandleMessage = editorExperiment('platform_editor_block_menu', true) ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
887
890
  br: jsx("br", null)
888
891
  }) : formatMessage(blockControlsMessages.dragToMove);
@@ -462,6 +462,7 @@ export var DragHandle = function DragHandle(_ref) {
462
462
  }
463
463
  if (nodeType === 'layoutColumn' && expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true)) {
464
464
  tr.setMeta('toggleLayoutColumnMenu', {
465
+ anchorPos: startPos,
465
466
  isOpen: true
466
467
  });
467
468
  }
@@ -515,6 +516,7 @@ export var DragHandle = function DragHandle(_ref) {
515
516
  }
516
517
  if (nodeType === 'layoutColumn' && expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true)) {
517
518
  tr.setMeta('toggleLayoutColumnMenu', {
519
+ anchorPos: startPos,
518
520
  isOpen: true
519
521
  });
520
522
  }
@@ -891,12 +893,13 @@ export var DragHandle = function DragHandle(_ref) {
891
893
  }
892
894
  var mSelect = api === null || api === void 0 || (_api$blockControls$sh4 = api.blockControls.sharedState.currentState()) === null || _api$blockControls$sh4 === void 0 ? void 0 : _api$blockControls$sh4.multiSelectDnD;
893
895
  var $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? view.state.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : view.state.selection.$anchor;
894
- if (isShiftDown && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
896
+ var isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
897
+ if (isShiftDown && !(isLayoutColumnMenuEnabled && isLayoutColumn) && (!isTopLevelNodeValue || isTopLevelNodeValue && $anchor.depth > DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH)) {
895
898
  setDragHandleDisabled(true);
896
899
  } else {
897
900
  setDragHandleDisabled(false);
898
901
  }
899
- }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
902
+ }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isLayoutColumn, isShiftDown, isTopLevelNodeValue, view]);
900
903
  var dragHandleMessage = editorExperiment('platform_editor_block_menu', true) ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
901
904
  br: jsx("br", null)
902
905
  }) : formatMessage(blockControlsMessages.dragToMove);
@@ -5,37 +5,39 @@
5
5
 
6
6
  import path from 'path';
7
7
 
8
- import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
8
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
9
9
 
10
10
  import packageJson from './package.json';
11
11
 
12
12
  const packagePath = path.resolve(__dirname);
13
13
 
14
- const documentation: ComponentStructuredContentSource[] = [
15
- {
16
- name: 'Editor Plugin Block Controls',
17
- description: 'Block controls plugin for @atlaskit/editor-core',
18
- status: 'general-availability',
19
- import: {
20
- name: 'blockControlsPlugin',
21
- package: '@atlaskit/editor-plugin-block-controls',
22
- type: 'named',
23
- packagePath,
24
- packageJson,
25
- },
26
- usageGuidelines: [],
27
- contentGuidelines: [],
28
- accessibilityGuidelines: [],
29
- keywords: ['editor', 'editor-plugin-block-controls', 'atlaskit'],
30
- categories: ['editor'],
31
- examples: [
32
- {
33
- name: 'Basic',
34
- description: 'Block controls plugin in composable editor.',
35
- source: path.resolve(packagePath, './examples/1-basic.tsx'),
14
+ const documentation: StructuredContentSource = {
15
+ components: [
16
+ {
17
+ name: 'Editor Plugin Block Controls',
18
+ description: 'Block controls plugin for @atlaskit/editor-core',
19
+ status: 'general-availability',
20
+ import: {
21
+ name: 'blockControlsPlugin',
22
+ package: '@atlaskit/editor-plugin-block-controls',
23
+ type: 'named',
24
+ packagePath,
25
+ packageJson,
36
26
  },
37
- ],
38
- },
39
- ];
27
+ usageGuidelines: [],
28
+ contentGuidelines: [],
29
+ accessibilityGuidelines: [],
30
+ keywords: ['editor', 'editor-plugin-block-controls', 'atlaskit'],
31
+ categories: ['editor'],
32
+ examples: [
33
+ {
34
+ name: 'Basic',
35
+ description: 'Block controls plugin in composable editor.',
36
+ source: path.resolve(packagePath, './examples/1-basic.tsx'),
37
+ },
38
+ ],
39
+ },
40
+ ],
41
+ };
40
42
 
41
43
  export default documentation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "11.4.7",
3
+ "version": "11.5.1",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,18 +47,18 @@
47
47
  "@atlaskit/editor-prosemirror": "^7.3.0",
48
48
  "@atlaskit/editor-shared-styles": "^3.11.0",
49
49
  "@atlaskit/editor-tables": "^2.10.0",
50
- "@atlaskit/icon": "^35.0.0",
51
- "@atlaskit/icon-lab": "^6.9.0",
50
+ "@atlaskit/icon": "^35.1.0",
51
+ "@atlaskit/icon-lab": "^6.10.0",
52
52
  "@atlaskit/link": "^3.4.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
- "@atlaskit/theme": "^24.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^82.3.0",
58
+ "@atlaskit/theme": "^25.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^83.0.0",
60
60
  "@atlaskit/tokens": "^13.0.0",
61
- "@atlaskit/tooltip": "^22.2.0",
61
+ "@atlaskit/tooltip": "^22.3.0",
62
62
  "@babel/runtime": "^7.0.0",
63
63
  "@emotion/react": "^11.7.1",
64
64
  "bind-event-listener": "^3.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^114.41.0",
70
+ "@atlaskit/editor-common": "^114.46.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"