@atlaskit/editor-plugin-layout 23.0.4 → 23.0.6

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,24 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 23.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f1454b828555b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1454b828555b) -
8
+ Clean up experiment `platform_editor_breakout_interaction_rerender`
9
+ - Updated dependencies
10
+
11
+ ## 23.0.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [`d7f1f4ebb1cd3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d7f1f4ebb1cd3) -
16
+ Keep the shipped layout column delete shortcut behavior for explicitly selected columns. Remove
17
+ the `platform_editor_layout_column_delete_shortcut_fix` and
18
+ `platform_editor_layout_column_valign_rendering` experiment keys. Consumers of these keys must
19
+ remove their experiment reads and use the shipped behavior directly.
20
+ - Updated dependencies
21
+
3
22
  ## 23.0.4
4
23
 
5
24
  ### Patch Changes
@@ -75,9 +75,6 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
75
75
  // put the selection into the first column of the layout
76
76
  (0, _utils.selectIntoLayout)(view, pos, 0);
77
77
  }, [getPos, view]);
78
- if (interactionState === 'hasNotHadInteraction' && !(0, _expValEquals.expValEquals)('platform_editor_breakout_interaction_rerender', 'isEnabled', true)) {
79
- return null;
80
- }
81
78
  return /*#__PURE__*/_react.default.createElement(_resizer.BreakoutResizer, {
82
79
  getRef: forwardRef,
83
80
  getPos: getPos,
@@ -85,7 +82,7 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
85
82
  nodeType: "layoutSection",
86
83
  getEditorWidth: getEditorWidth,
87
84
  disabled: (0, _editorExperiment.editorExperiment)('platform_editor_breakout_resizing', true) ? true : editorDisabled === true || !isBreakoutAvailable(view.state.schema),
88
- hidden: interactionState === 'hasNotHadInteraction' && (0, _expValEquals.expValEquals)('platform_editor_breakout_interaction_rerender', 'isEnabled', true),
85
+ hidden: interactionState === 'hasNotHadInteraction',
89
86
  parentRef: parentRef,
90
87
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
91
88
  displayGuidelines: (0, _editorExperiment.editorExperiment)('single_column_layouts', true) ? displayGuidelines : undefined,
@@ -18,7 +18,6 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
18
18
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
19
19
  var _fg = require("@atlaskit/platform-feature-flags/fg");
20
20
  var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
21
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
21
  var _consts = require("./consts");
23
22
  var _pluginKey = require("./plugin-key");
24
23
  var _layoutColumnDistribution = require("./utils/layout-column-distribution");
@@ -892,7 +891,7 @@ var deleteLayoutColumn = exports.deleteLayoutColumn = function deleteLayoutColum
892
891
  // Only delete columns that are explicitly selected (a column NodeSelection or a selection
893
892
  // fully containing columns). This stops a bare caret inside a column — including inside
894
893
  // nested content such as a table — from deleting the whole column via the delete shortcut.
895
- var selectedLayoutColumnsResult = (0, _expValEquals.expValEquals)('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? (0, _layoutColumnSelection.getSelectedLayoutColumnsFromSelection)(tr.selection) : (0, _layoutColumnSelection.getLayoutColumnsFromContentSelection)(tr.selection);
894
+ var selectedLayoutColumnsResult = (0, _layoutColumnSelection.getSelectedLayoutColumnsFromSelection)(tr.selection);
896
895
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
897
896
  return null;
898
897
  }
@@ -957,15 +956,12 @@ var deleteLayoutColumn = exports.deleteLayoutColumn = function deleteLayoutColum
957
956
  }, existingWidths);
958
957
  var updatedLayoutSectionNode = layoutSectionNode.copy(_model.Fragment.fromArray(remainingColumns));
959
958
 
960
- // The cursor-in-column (keyboard) path has a plain text selection; the menu path has a
961
- // column NodeSelection whose post-delete landing is owned by the block-controls
962
- // preserved-selection plugin, so we only restore the caret for the former.
959
+ // A text selection can fully contain columns. Restore its caret in a remaining column;
960
+ // block controls own the landing for a column NodeSelection.
963
961
  var hadTextSelection = tr.selection instanceof _state.TextSelection;
964
962
  tr.replaceWith(layoutSectionPos + 1, layoutSectionPos + layoutSectionNode.nodeSize - 1, columnWidth(updatedLayoutSectionNode, tr.doc.type.schema, redistributed));
965
963
 
966
- // Land the caret in a remaining column — the one now occupying the deleted slot, or the
967
- // last column when the deleted slot no longer exists. Otherwise the replace above maps
968
- // the caret out of the layout to the following paragraph.
964
+ // Keep a text selection within the layout after the selected columns are removed.
969
965
  var remainingColumnCount = remainingColumns.length;
970
966
  if (hadTextSelection && remainingColumnCount > 0) {
971
967
  var targetColumnIndex = Math.min(startIndex, remainingColumnCount - 1);
@@ -58,9 +58,6 @@ const LayoutBreakoutResizer = ({
58
58
  // put the selection into the first column of the layout
59
59
  selectIntoLayout(view, pos, 0);
60
60
  }, [getPos, view]);
61
- if (interactionState === 'hasNotHadInteraction' && !expValEquals('platform_editor_breakout_interaction_rerender', 'isEnabled', true)) {
62
- return null;
63
- }
64
61
  return /*#__PURE__*/React.createElement(BreakoutResizer, {
65
62
  getRef: forwardRef,
66
63
  getPos: getPos,
@@ -68,7 +65,7 @@ const LayoutBreakoutResizer = ({
68
65
  nodeType: "layoutSection",
69
66
  getEditorWidth: getEditorWidth,
70
67
  disabled: editorExperiment('platform_editor_breakout_resizing', true) ? true : editorDisabled === true || !isBreakoutAvailable(view.state.schema),
71
- hidden: interactionState === 'hasNotHadInteraction' && expValEquals('platform_editor_breakout_interaction_rerender', 'isEnabled', true),
68
+ hidden: interactionState === 'hasNotHadInteraction',
72
69
  parentRef: parentRef,
73
70
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
74
71
  displayGuidelines: editorExperiment('single_column_layouts', true) ? displayGuidelines : undefined,
@@ -7,7 +7,6 @@ import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
7
7
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
10
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
10
  import { DEFAULT_LAYOUT_COLUMN_VALIGN, EVEN_DISTRIBUTED_COL_WIDTHS, MAX_LAYOUT_COLUMNS, MAX_STANDARD_LAYOUT_COLUMNS, MIN_LAYOUT_COLUMN_WIDTH_PERCENT } from './consts';
12
11
  import { pluginKey } from './plugin-key';
13
12
  import { calculateDistribution, isDistributedUniformly, redistributeAfterDeletion, redistributeProportionally } from './utils/layout-column-distribution';
@@ -856,7 +855,7 @@ export const deleteLayoutColumn = ({
856
855
  // Only delete columns that are explicitly selected (a column NodeSelection or a selection
857
856
  // fully containing columns). This stops a bare caret inside a column — including inside
858
857
  // nested content such as a table — from deleting the whole column via the delete shortcut.
859
- const selectedLayoutColumnsResult = expValEquals('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? getSelectedLayoutColumnsFromSelection(tr.selection) : getLayoutColumnsFromContentSelection(tr.selection);
858
+ const selectedLayoutColumnsResult = getSelectedLayoutColumnsFromSelection(tr.selection);
860
859
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
861
860
  return null;
862
861
  }
@@ -916,15 +915,12 @@ export const deleteLayoutColumn = ({
916
915
  .reverse().reduce((widths, selectedIndex) => redistributeAfterDeletion(widths, selectedIndex, MIN_LAYOUT_COLUMN_WIDTH_PERCENT), existingWidths);
917
916
  const updatedLayoutSectionNode = layoutSectionNode.copy(Fragment.fromArray(remainingColumns));
918
917
 
919
- // The cursor-in-column (keyboard) path has a plain text selection; the menu path has a
920
- // column NodeSelection whose post-delete landing is owned by the block-controls
921
- // preserved-selection plugin, so we only restore the caret for the former.
918
+ // A text selection can fully contain columns. Restore its caret in a remaining column;
919
+ // block controls own the landing for a column NodeSelection.
922
920
  const hadTextSelection = tr.selection instanceof TextSelection;
923
921
  tr.replaceWith(layoutSectionPos + 1, layoutSectionPos + layoutSectionNode.nodeSize - 1, columnWidth(updatedLayoutSectionNode, tr.doc.type.schema, redistributed));
924
922
 
925
- // Land the caret in a remaining column — the one now occupying the deleted slot, or the
926
- // last column when the deleted slot no longer exists. Otherwise the replace above maps
927
- // the caret out of the layout to the following paragraph.
923
+ // Keep a text selection within the layout after the selected columns are removed.
928
924
  const remainingColumnCount = remainingColumns.length;
929
925
  if (hadTextSelection && remainingColumnCount > 0) {
930
926
  const targetColumnIndex = Math.min(startIndex, remainingColumnCount - 1);
@@ -66,9 +66,6 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
66
66
  // put the selection into the first column of the layout
67
67
  selectIntoLayout(view, pos, 0);
68
68
  }, [getPos, view]);
69
- if (interactionState === 'hasNotHadInteraction' && !expValEquals('platform_editor_breakout_interaction_rerender', 'isEnabled', true)) {
70
- return null;
71
- }
72
69
  return /*#__PURE__*/React.createElement(BreakoutResizer, {
73
70
  getRef: forwardRef,
74
71
  getPos: getPos,
@@ -76,7 +73,7 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
76
73
  nodeType: "layoutSection",
77
74
  getEditorWidth: getEditorWidth,
78
75
  disabled: editorExperiment('platform_editor_breakout_resizing', true) ? true : editorDisabled === true || !isBreakoutAvailable(view.state.schema),
79
- hidden: interactionState === 'hasNotHadInteraction' && expValEquals('platform_editor_breakout_interaction_rerender', 'isEnabled', true),
76
+ hidden: interactionState === 'hasNotHadInteraction',
80
77
  parentRef: parentRef,
81
78
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
82
79
  displayGuidelines: editorExperiment('single_column_layouts', true) ? displayGuidelines : undefined,
@@ -10,7 +10,6 @@ import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
10
10
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
11
11
  import { fg } from '@atlaskit/platform-feature-flags/fg';
12
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import { DEFAULT_LAYOUT_COLUMN_VALIGN, EVEN_DISTRIBUTED_COL_WIDTHS, MAX_LAYOUT_COLUMNS, MAX_STANDARD_LAYOUT_COLUMNS, MIN_LAYOUT_COLUMN_WIDTH_PERCENT } from './consts';
15
14
  import { pluginKey } from './plugin-key';
16
15
  import { calculateDistribution, isDistributedUniformly, redistributeAfterDeletion, redistributeProportionally } from './utils/layout-column-distribution';
@@ -882,7 +881,7 @@ export var deleteLayoutColumn = function deleteLayoutColumn() {
882
881
  // Only delete columns that are explicitly selected (a column NodeSelection or a selection
883
882
  // fully containing columns). This stops a bare caret inside a column — including inside
884
883
  // nested content such as a table — from deleting the whole column via the delete shortcut.
885
- var selectedLayoutColumnsResult = expValEquals('platform_editor_layout_column_delete_shortcut_fix', 'isEnabled', true) ? getSelectedLayoutColumnsFromSelection(tr.selection) : getLayoutColumnsFromContentSelection(tr.selection);
884
+ var selectedLayoutColumnsResult = getSelectedLayoutColumnsFromSelection(tr.selection);
886
885
  if (!selectedLayoutColumnsResult || selectedLayoutColumnsResult.selectedLayoutColumns.length === 0) {
887
886
  return null;
888
887
  }
@@ -947,15 +946,12 @@ export var deleteLayoutColumn = function deleteLayoutColumn() {
947
946
  }, existingWidths);
948
947
  var updatedLayoutSectionNode = layoutSectionNode.copy(Fragment.fromArray(remainingColumns));
949
948
 
950
- // The cursor-in-column (keyboard) path has a plain text selection; the menu path has a
951
- // column NodeSelection whose post-delete landing is owned by the block-controls
952
- // preserved-selection plugin, so we only restore the caret for the former.
949
+ // A text selection can fully contain columns. Restore its caret in a remaining column;
950
+ // block controls own the landing for a column NodeSelection.
953
951
  var hadTextSelection = tr.selection instanceof TextSelection;
954
952
  tr.replaceWith(layoutSectionPos + 1, layoutSectionPos + layoutSectionNode.nodeSize - 1, columnWidth(updatedLayoutSectionNode, tr.doc.type.schema, redistributed));
955
953
 
956
- // Land the caret in a remaining column — the one now occupying the deleted slot, or the
957
- // last column when the deleted slot no longer exists. Otherwise the replace above maps
958
- // the caret out of the layout to the following paragraph.
954
+ // Keep a text selection within the layout after the selected columns are removed.
959
955
  var remainingColumnCount = remainingColumns.length;
960
956
  if (hadTextSelection && remainingColumnCount > 0) {
961
957
  var targetColumnIndex = Math.min(startIndex, remainingColumnCount - 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "23.0.4",
3
+ "version": "23.0.6",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,14 +43,14 @@
43
43
  "@atlaskit/icon-lab": "^7.11.0",
44
44
  "@atlaskit/platform-feature-experiments": "^0.3.0",
45
45
  "@atlaskit/platform-feature-flags": "^2.2.0",
46
- "@atlaskit/tmp-editor-statsig": "^213.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^215.0.0",
47
47
  "@atlaskit/tokens": "^20.1.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "bind-event-listener": "^3.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^126.2.0",
53
+ "@atlaskit/editor-common": "^126.3.0",
54
54
  "react": "^18.2.0 || ^19.2.0",
55
55
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
56
56
  },