@atlaskit/editor-plugin-layout 13.3.20 → 13.3.22

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,33 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 13.3.22
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b90bdc71cdf99`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b90bdc71cdf99) -
8
+ Fix layout column delete shortcut deleting the whole column when the caret is a text selection
9
+ inside a column (e.g. a table nested in a layout), gated behind
10
+ platform_editor_layout_column_delete_shortcut_fix.
11
+
12
+ Adds a new experiment key `platform_editor_layout_column_delete_shortcut_fix` to
13
+ `@atlaskit/tmp-editor-statsig`. Usage:
14
+
15
+ ```ts
16
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
+
18
+ if (expValEquals('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true)) {
19
+ // new behaviour: preserve the column when the caret is a text selection inside it
20
+ }
21
+ ```
22
+
23
+ - Updated dependencies
24
+
25
+ ## 13.3.21
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+
3
31
  ## 13.3.20
4
32
 
5
33
  ### Patch Changes
@@ -910,7 +910,11 @@ var deleteLayoutColumn = exports.deleteLayoutColumn = function deleteLayoutColum
910
910
  if (!(0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true)) {
911
911
  return null;
912
912
  }
913
- var selectedLayoutColumnsResult = (0, _layoutColumnSelection.getLayoutColumnsFromContentSelection)(tr.selection);
913
+
914
+ // Only delete columns that are explicitly selected (a column NodeSelection or a selection
915
+ // fully containing columns). This stops a bare caret inside a column — including inside
916
+ // nested content such as a table — from deleting the whole column via the delete shortcut.
917
+ var selectedLayoutColumnsResult = (0, _expValEquals.expValEquals)('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? (0, _layoutColumnSelection.getSelectedLayoutColumnsFromSelection)(tr.selection) : (0, _layoutColumnSelection.getLayoutColumnsFromContentSelection)(tr.selection);
914
918
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
915
919
  return null;
916
920
  }
@@ -874,7 +874,11 @@ export const deleteLayoutColumn = ({
874
874
  if (!expValEquals('platform_editor_layout_column_menu', 'isEnabled', true)) {
875
875
  return null;
876
876
  }
877
- const selectedLayoutColumnsResult = getLayoutColumnsFromContentSelection(tr.selection);
877
+
878
+ // Only delete columns that are explicitly selected (a column NodeSelection or a selection
879
+ // fully containing columns). This stops a bare caret inside a column — including inside
880
+ // nested content such as a table — from deleting the whole column via the delete shortcut.
881
+ const selectedLayoutColumnsResult = expValEquals('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? getSelectedLayoutColumnsFromSelection(tr.selection) : getLayoutColumnsFromContentSelection(tr.selection);
878
882
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
879
883
  return null;
880
884
  }
@@ -900,7 +900,11 @@ export var deleteLayoutColumn = function deleteLayoutColumn() {
900
900
  if (!expValEquals('platform_editor_layout_column_menu', 'isEnabled', true)) {
901
901
  return null;
902
902
  }
903
- var selectedLayoutColumnsResult = getLayoutColumnsFromContentSelection(tr.selection);
903
+
904
+ // Only delete columns that are explicitly selected (a column NodeSelection or a selection
905
+ // fully containing columns). This stops a bare caret inside a column — including inside
906
+ // nested content such as a table — from deleting the whole column via the delete shortcut.
907
+ var selectedLayoutColumnsResult = expValEquals('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? getSelectedLayoutColumnsFromSelection(tr.selection) : getLayoutColumnsFromContentSelection(tr.selection);
904
908
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
905
909
  return null;
906
910
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "13.3.20",
3
+ "version": "13.3.22",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,7 @@
24
24
  "@atlaskit/adf-schema": "^56.1.0",
25
25
  "@atlaskit/css": "^1.0.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^12.0.0",
27
- "@atlaskit/editor-plugin-block-controls": "^13.2.0",
27
+ "@atlaskit/editor-plugin-block-controls": "^13.3.0",
28
28
  "@atlaskit/editor-plugin-block-menu": "^11.1.0",
29
29
  "@atlaskit/editor-plugin-decorations": "^12.0.0",
30
30
  "@atlaskit/editor-plugin-editor-disabled": "^12.0.0",
@@ -42,14 +42,14 @@
42
42
  "@atlaskit/icon": "^37.1.0",
43
43
  "@atlaskit/icon-lab": "^7.4.0",
44
44
  "@atlaskit/platform-feature-flags": "^2.1.0",
45
- "@atlaskit/tmp-editor-statsig": "^132.0.0",
46
- "@atlaskit/tokens": "^16.2.0",
45
+ "@atlaskit/tmp-editor-statsig": "^133.2.0",
46
+ "@atlaskit/tokens": "^16.3.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1",
49
49
  "bind-event-listener": "^3.0.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@atlaskit/editor-common": "^116.35.0",
52
+ "@atlaskit/editor-common": "^116.39.0",
53
53
  "react": "^18.2.0",
54
54
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
55
55
  },