@atlaskit/editor-plugin-block-menu 7.0.1 → 7.0.2

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,13 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 7.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1b1c6f7936019`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1b1c6f7936019) -
8
+ Cleanup fg: platform_editor_block_menu_expand_localid_fix
9
+ - Updated dependencies
10
+
3
11
  ## 7.0.1
4
12
 
5
13
  ### Patch Changes
@@ -8,7 +8,6 @@ exports.wrapMixedContentStep = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _utils = require("@atlaskit/editor-common/utils");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _marks = require("../marks");
13
12
  var _types = require("../types");
14
13
  var _utils2 = require("../utils");
@@ -38,12 +37,8 @@ var createTextContentContainer = function createTextContentContainer(textContent
38
37
  * Creates a regular container with node content.
39
38
  */
40
39
  var createNodeContentContainer = function createNodeContentContainer(nodeContent, targetNodeType) {
41
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
42
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
43
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
44
- // To clean up: remove the if-else, always use the flag-on branch.
45
40
  var isExpandType = targetNodeType.name === 'expand' || targetNodeType.name === 'nestedExpand';
46
- var nodeAttrs = isExpandType && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
41
+ var nodeAttrs = isExpandType ? {
47
42
  localId: crypto.randomUUID()
48
43
  } : {};
49
44
  return targetNodeType.createAndFill(nodeAttrs, nodeContent);
@@ -81,11 +76,8 @@ var handleEmptyContainerEdgeCase = function handleEmptyContainerEdgeCase(result,
81
76
  return emptyCodeBlock ? [emptyCodeBlock].concat((0, _toConsumableArray2.default)(result)) : result;
82
77
  }
83
78
  var emptyParagraph = schema.nodes.paragraph.create();
84
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
85
- // Same localId pre-assignment rationale as createNodeContentContainer above.
86
- // To clean up: remove the if-else, always use the flag-on branch.
87
79
  var isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
88
- var emptyContainerAttrs = isExpandType && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
80
+ var emptyContainerAttrs = isExpandType ? {
89
81
  localId: crypto.randomUUID()
90
82
  } : {};
91
83
  var emptyContainer = targetNodeType.create(emptyContainerAttrs, emptyParagraph);
@@ -1,18 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.isTextNode = exports.getTargetNodeTypeNameInContext = exports.getSelectedNode = exports.getBlockNodesInRange = exports.createTextContent = exports.convertTextNodeToParagraph = exports.convertNestedExpandToExpand = exports.convertExpandToNestedExpand = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _state = require("@atlaskit/editor-prosemirror/state");
10
8
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
9
  var _editorTables = require("@atlaskit/editor-tables");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
10
  var _types = require("./types");
14
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
11
  /**
17
12
  * Determines if a node is a text node (heading or paragraph).
18
13
  * Text nodes can have their content converted to paragraphs when they can't be wrapped directly.
@@ -84,17 +79,10 @@ var convertNestedExpandToExpand = exports.convertNestedExpandToExpand = function
84
79
  if (!expandType) {
85
80
  return null;
86
81
  }
87
-
88
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
89
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
90
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
91
- // To clean up: remove the if-else, always include localId in attrs.
92
- var localIdAttr = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
82
+ return expandType.createAndFill({
83
+ title: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.title) || '',
93
84
  localId: crypto.randomUUID()
94
- } : {};
95
- return expandType.createAndFill(_objectSpread({
96
- title: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.title) || ''
97
- }, localIdAttr), node.content);
85
+ }, node.content);
98
86
  };
99
87
 
100
88
  /**
@@ -108,16 +96,10 @@ var convertExpandToNestedExpand = exports.convertExpandToNestedExpand = function
108
96
  if (!nestedExpandType) {
109
97
  return null;
110
98
  }
111
-
112
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
113
- // Same localId pre-assignment rationale as convertNestedExpandToExpand above.
114
- // To clean up: remove the if-else, always include localId in attrs.
115
- var localIdAttr = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
99
+ return nestedExpandType.createAndFill({
100
+ title: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.title) || '',
116
101
  localId: crypto.randomUUID()
117
- } : {};
118
- return nestedExpandType.createAndFill(_objectSpread({
119
- title: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.title) || ''
120
- }, localIdAttr), node.content);
102
+ }, node.content);
121
103
  };
122
104
 
123
105
  /**
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.wrapStep = void 0;
7
7
  var _utils = require("@atlaskit/editor-common/utils");
8
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
8
  var _marks = require("./marks");
10
9
  var _utils2 = require("./utils");
11
10
  /**
@@ -34,14 +33,8 @@ var wrapStep = exports.wrapStep = function wrapStep(nodes, context) {
34
33
  });
35
34
  }
36
35
  var targetNodeType = schema.nodes[targetNodeTypeName];
37
-
38
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
39
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
40
- // object (via setNodeAttribute), which would invalidate the expandedState WeakMap entry set
41
- // in transformNode.ts and cause the expand to render as collapsed.
42
- // To clean up: remove the if-else, always use the flag-on branch (isExpandType with uuid).
43
36
  var isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
44
- var nodeAttrs = isExpandType && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
37
+ var nodeAttrs = isExpandType ? {
45
38
  localId: crypto.randomUUID()
46
39
  } : {};
47
40
  var sourceSupportsBreakout = _utils.breakoutResizableNodes.includes(fromNode.type.name);
@@ -12,7 +12,6 @@ var _selection = require("@atlaskit/editor-common/selection");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _transform = require("@atlaskit/editor-prosemirror/transform");
14
14
  var _editorTables = require("@atlaskit/editor-tables");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _isNestedNode = require("../ui/utils/isNestedNode");
17
16
  var _transform2 = require("./transform-node-utils/transform");
18
17
  var _utils = require("./transforms/utils");
@@ -55,23 +54,13 @@ var transformNode = exports.transformNode = function transformNode(api) {
55
54
  });
56
55
  var content = resultNodes.length > 0 ? resultNodes : sourceNodes;
57
56
  var sliceStart = isList ? $from.pos - 1 : $from.pos;
58
-
59
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
60
- // Pre-populates the expandedState WeakMap so ExpandNodeView initializes newly created
61
- // expand/nestedExpand nodes as expanded rather than collapsed. Works in conjunction with
62
- // the localId pre-assignment in the transform steps — without a pre-assigned localId the
63
- // localId plugin's appendTransaction replaces the node object (via setNodeAttribute),
64
- // invalidating this WeakMap entry. The else branch preserves the previous behaviour.
65
- // To clean up: remove the if-else block and keep only the flag-on body.
66
- if ((0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix')) {
67
- var expand = nodes.expand,
68
- nestedExpand = nodes.nestedExpand;
69
- content.forEach(function (node) {
70
- if (node.type === expand || node.type === nestedExpand) {
71
- _expand.expandedState.set(node, true);
72
- }
73
- });
74
- }
57
+ var expand = nodes.expand,
58
+ nestedExpand = nodes.nestedExpand;
59
+ content.forEach(function (node) {
60
+ if (node.type === expand || node.type === nestedExpand) {
61
+ _expand.expandedState.set(node, true);
62
+ }
63
+ });
75
64
  if (preservedSelection instanceof _state.NodeSelection && preservedSelection.node.type === nodes.mediaSingle) {
76
65
  var _api$blockControls2;
77
66
  // when node is media single, use tr.replaceWith freeze editor, if modify position, tr.replaceWith creates duplicats
@@ -1,6 +1,5 @@
1
1
  import { breakoutResizableNodes } from '@atlaskit/editor-common/utils';
2
2
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { removeDisallowedMarks } from '../marks';
5
4
  import { NODE_CATEGORY_BY_TYPE } from '../types';
6
5
  import { convertTextNodeToParagraph, createTextContent, isTextNode } from '../utils';
@@ -31,12 +30,8 @@ const createTextContentContainer = (textContentArray, targetNodeType, schema) =>
31
30
  * Creates a regular container with node content.
32
31
  */
33
32
  const createNodeContentContainer = (nodeContent, targetNodeType) => {
34
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
35
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
36
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
37
- // To clean up: remove the if-else, always use the flag-on branch.
38
33
  const isExpandType = targetNodeType.name === 'expand' || targetNodeType.name === 'nestedExpand';
39
- const nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
34
+ const nodeAttrs = isExpandType ? {
40
35
  localId: crypto.randomUUID()
41
36
  } : {};
42
37
  return targetNodeType.createAndFill(nodeAttrs, nodeContent);
@@ -74,11 +69,8 @@ const handleEmptyContainerEdgeCase = (result, hasCreatedContainer, fromNode, tar
74
69
  return emptyCodeBlock ? [emptyCodeBlock, ...result] : result;
75
70
  }
76
71
  const emptyParagraph = schema.nodes.paragraph.create();
77
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
78
- // Same localId pre-assignment rationale as createNodeContentContainer above.
79
- // To clean up: remove the if-else, always use the flag-on branch.
80
72
  const isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
81
- const emptyContainerAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
73
+ const emptyContainerAttrs = isExpandType ? {
82
74
  localId: crypto.randomUUID()
83
75
  } : {};
84
76
  const emptyContainer = targetNodeType.create(emptyContainerAttrs, emptyParagraph);
@@ -1,7 +1,6 @@
1
1
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
3
3
  import { CellSelection } from '@atlaskit/editor-tables';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { NODE_CATEGORY_BY_TYPE } from './types';
6
5
 
7
6
  /**
@@ -76,17 +75,9 @@ export const convertNestedExpandToExpand = (node, schema) => {
76
75
  if (!expandType) {
77
76
  return null;
78
77
  }
79
-
80
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
81
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
82
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
83
- // To clean up: remove the if-else, always include localId in attrs.
84
- const localIdAttr = fg('platform_editor_block_menu_expand_localid_fix') ? {
85
- localId: crypto.randomUUID()
86
- } : {};
87
78
  return expandType.createAndFill({
88
79
  title: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.title) || '',
89
- ...localIdAttr
80
+ localId: crypto.randomUUID()
90
81
  }, node.content);
91
82
  };
92
83
 
@@ -101,16 +92,9 @@ export const convertExpandToNestedExpand = (node, schema) => {
101
92
  if (!nestedExpandType) {
102
93
  return null;
103
94
  }
104
-
105
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
106
- // Same localId pre-assignment rationale as convertNestedExpandToExpand above.
107
- // To clean up: remove the if-else, always include localId in attrs.
108
- const localIdAttr = fg('platform_editor_block_menu_expand_localid_fix') ? {
109
- localId: crypto.randomUUID()
110
- } : {};
111
95
  return nestedExpandType.createAndFill({
112
96
  title: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.title) || '',
113
- ...localIdAttr
97
+ localId: crypto.randomUUID()
114
98
  }, node.content);
115
99
  };
116
100
 
@@ -1,5 +1,4 @@
1
1
  import { breakoutResizableNodes } from '@atlaskit/editor-common/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { removeDisallowedMarks } from './marks';
4
3
  import { convertExpandToNestedExpand } from './utils';
5
4
 
@@ -31,14 +30,8 @@ export const wrapStep = (nodes, context) => {
31
30
  });
32
31
  }
33
32
  const targetNodeType = schema.nodes[targetNodeTypeName];
34
-
35
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
36
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
37
- // object (via setNodeAttribute), which would invalidate the expandedState WeakMap entry set
38
- // in transformNode.ts and cause the expand to render as collapsed.
39
- // To clean up: remove the if-else, always use the flag-on branch (isExpandType with uuid).
40
33
  const isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
41
- const nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
34
+ const nodeAttrs = isExpandType ? {
42
35
  localId: crypto.randomUUID()
43
36
  } : {};
44
37
  const sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
@@ -6,7 +6,6 @@ import { expandSelectionToBlockRange, getSourceNodesFromSelectionRange } from '@
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
8
8
  import { CellSelection } from '@atlaskit/editor-tables';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { isNestedNode } from '../ui/utils/isNestedNode';
11
10
  import { convertNodesToTargetType } from './transform-node-utils/transform';
12
11
  import { isListNode } from './transforms/utils';
@@ -51,25 +50,15 @@ export const transformNode = api => (targetType, metadata) => ({
51
50
  });
52
51
  const content = resultNodes.length > 0 ? resultNodes : sourceNodes;
53
52
  const sliceStart = isList ? $from.pos - 1 : $from.pos;
54
-
55
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
56
- // Pre-populates the expandedState WeakMap so ExpandNodeView initializes newly created
57
- // expand/nestedExpand nodes as expanded rather than collapsed. Works in conjunction with
58
- // the localId pre-assignment in the transform steps — without a pre-assigned localId the
59
- // localId plugin's appendTransaction replaces the node object (via setNodeAttribute),
60
- // invalidating this WeakMap entry. The else branch preserves the previous behaviour.
61
- // To clean up: remove the if-else block and keep only the flag-on body.
62
- if (fg('platform_editor_block_menu_expand_localid_fix')) {
63
- const {
64
- expand,
65
- nestedExpand
66
- } = nodes;
67
- content.forEach(node => {
68
- if (node.type === expand || node.type === nestedExpand) {
69
- expandedState.set(node, true);
70
- }
71
- });
72
- }
53
+ const {
54
+ expand,
55
+ nestedExpand
56
+ } = nodes;
57
+ content.forEach(node => {
58
+ if (node.type === expand || node.type === nestedExpand) {
59
+ expandedState.set(node, true);
60
+ }
61
+ });
73
62
  if (preservedSelection instanceof NodeSelection && preservedSelection.node.type === nodes.mediaSingle) {
74
63
  var _api$blockControls2;
75
64
  // when node is media single, use tr.replaceWith freeze editor, if modify position, tr.replaceWith creates duplicats
@@ -1,7 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { breakoutResizableNodes } from '@atlaskit/editor-common/utils';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { removeDisallowedMarks } from '../marks';
6
5
  import { NODE_CATEGORY_BY_TYPE } from '../types';
7
6
  import { convertTextNodeToParagraph, createTextContent, isTextNode } from '../utils';
@@ -32,12 +31,8 @@ var createTextContentContainer = function createTextContentContainer(textContent
32
31
  * Creates a regular container with node content.
33
32
  */
34
33
  var createNodeContentContainer = function createNodeContentContainer(nodeContent, targetNodeType) {
35
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
36
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
37
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
38
- // To clean up: remove the if-else, always use the flag-on branch.
39
34
  var isExpandType = targetNodeType.name === 'expand' || targetNodeType.name === 'nestedExpand';
40
- var nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
35
+ var nodeAttrs = isExpandType ? {
41
36
  localId: crypto.randomUUID()
42
37
  } : {};
43
38
  return targetNodeType.createAndFill(nodeAttrs, nodeContent);
@@ -75,11 +70,8 @@ var handleEmptyContainerEdgeCase = function handleEmptyContainerEdgeCase(result,
75
70
  return emptyCodeBlock ? [emptyCodeBlock].concat(_toConsumableArray(result)) : result;
76
71
  }
77
72
  var emptyParagraph = schema.nodes.paragraph.create();
78
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
79
- // Same localId pre-assignment rationale as createNodeContentContainer above.
80
- // To clean up: remove the if-else, always use the flag-on branch.
81
73
  var isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
82
- var emptyContainerAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
74
+ var emptyContainerAttrs = isExpandType ? {
83
75
  localId: crypto.randomUUID()
84
76
  } : {};
85
77
  var emptyContainer = targetNodeType.create(emptyContainerAttrs, emptyParagraph);
@@ -1,10 +1,6 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
1
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
5
2
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
6
3
  import { CellSelection } from '@atlaskit/editor-tables';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
4
  import { NODE_CATEGORY_BY_TYPE } from './types';
9
5
 
10
6
  /**
@@ -78,17 +74,10 @@ export var convertNestedExpandToExpand = function convertNestedExpandToExpand(no
78
74
  if (!expandType) {
79
75
  return null;
80
76
  }
81
-
82
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
83
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
84
- // object, preserving the expandedState WeakMap entry set in transformNode.ts.
85
- // To clean up: remove the if-else, always include localId in attrs.
86
- var localIdAttr = fg('platform_editor_block_menu_expand_localid_fix') ? {
77
+ return expandType.createAndFill({
78
+ title: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.title) || '',
87
79
  localId: crypto.randomUUID()
88
- } : {};
89
- return expandType.createAndFill(_objectSpread({
90
- title: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.title) || ''
91
- }, localIdAttr), node.content);
80
+ }, node.content);
92
81
  };
93
82
 
94
83
  /**
@@ -102,16 +91,10 @@ export var convertExpandToNestedExpand = function convertExpandToNestedExpand(no
102
91
  if (!nestedExpandType) {
103
92
  return null;
104
93
  }
105
-
106
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
107
- // Same localId pre-assignment rationale as convertNestedExpandToExpand above.
108
- // To clean up: remove the if-else, always include localId in attrs.
109
- var localIdAttr = fg('platform_editor_block_menu_expand_localid_fix') ? {
94
+ return nestedExpandType.createAndFill({
95
+ title: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.title) || '',
110
96
  localId: crypto.randomUUID()
111
- } : {};
112
- return nestedExpandType.createAndFill(_objectSpread({
113
- title: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.title) || ''
114
- }, localIdAttr), node.content);
97
+ }, node.content);
115
98
  };
116
99
 
117
100
  /**
@@ -1,5 +1,4 @@
1
1
  import { breakoutResizableNodes } from '@atlaskit/editor-common/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { removeDisallowedMarks } from './marks';
4
3
  import { convertExpandToNestedExpand } from './utils';
5
4
 
@@ -29,14 +28,8 @@ export var wrapStep = function wrapStep(nodes, context) {
29
28
  });
30
29
  }
31
30
  var targetNodeType = schema.nodes[targetNodeTypeName];
32
-
33
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
34
- // Pre-assigns a localId so the localId plugin's appendTransaction does not replace the node
35
- // object (via setNodeAttribute), which would invalidate the expandedState WeakMap entry set
36
- // in transformNode.ts and cause the expand to render as collapsed.
37
- // To clean up: remove the if-else, always use the flag-on branch (isExpandType with uuid).
38
31
  var isExpandType = targetNodeTypeName === 'expand' || targetNodeTypeName === 'nestedExpand';
39
- var nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
32
+ var nodeAttrs = isExpandType ? {
40
33
  localId: crypto.randomUUID()
41
34
  } : {};
42
35
  var sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
@@ -6,7 +6,6 @@ import { expandSelectionToBlockRange, getSourceNodesFromSelectionRange } from '@
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
8
8
  import { CellSelection } from '@atlaskit/editor-tables';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { isNestedNode } from '../ui/utils/isNestedNode';
11
10
  import { convertNodesToTargetType } from './transform-node-utils/transform';
12
11
  import { isListNode } from './transforms/utils';
@@ -49,23 +48,13 @@ export var transformNode = function transformNode(api) {
49
48
  });
50
49
  var content = resultNodes.length > 0 ? resultNodes : sourceNodes;
51
50
  var sliceStart = isList ? $from.pos - 1 : $from.pos;
52
-
53
- // [FEATURE FLAG: platform_editor_block_menu_expand_localid_fix]
54
- // Pre-populates the expandedState WeakMap so ExpandNodeView initializes newly created
55
- // expand/nestedExpand nodes as expanded rather than collapsed. Works in conjunction with
56
- // the localId pre-assignment in the transform steps — without a pre-assigned localId the
57
- // localId plugin's appendTransaction replaces the node object (via setNodeAttribute),
58
- // invalidating this WeakMap entry. The else branch preserves the previous behaviour.
59
- // To clean up: remove the if-else block and keep only the flag-on body.
60
- if (fg('platform_editor_block_menu_expand_localid_fix')) {
61
- var expand = nodes.expand,
62
- nestedExpand = nodes.nestedExpand;
63
- content.forEach(function (node) {
64
- if (node.type === expand || node.type === nestedExpand) {
65
- expandedState.set(node, true);
66
- }
67
- });
68
- }
51
+ var expand = nodes.expand,
52
+ nestedExpand = nodes.nestedExpand;
53
+ content.forEach(function (node) {
54
+ if (node.type === expand || node.type === nestedExpand) {
55
+ expandedState.set(node, true);
56
+ }
57
+ });
69
58
  if (preservedSelection instanceof NodeSelection && preservedSelection.node.type === nodes.mediaSingle) {
70
59
  var _api$blockControls2;
71
60
  // when node is media single, use tr.replaceWith freeze editor, if modify position, tr.replaceWith creates duplicats
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "bind-event-listener": "^3.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^112.0.0",
53
+ "@atlaskit/editor-common": "^112.1.0",
54
54
  "react": "^18.2.0",
55
55
  "react-intl-next": "npm:react-intl@^5.18.1"
56
56
  },
@@ -97,9 +97,6 @@
97
97
  "platform_editor_block_menu_copy_section": {
98
98
  "type": "boolean"
99
99
  },
100
- "platform_editor_block_menu_expand_localid_fix": {
101
- "type": "boolean"
102
- },
103
100
  "platform_editor_block_menu_v2_patch_2": {
104
101
  "type": "boolean"
105
102
  },