@atlaskit/editor-plugin-block-controls 16.0.3 → 16.0.5

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,35 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 16.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 16.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`76e9f6152bf16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76e9f6152bf16) -
14
+ Enable launched synced block integrations and remove obsolete experiment scaffolding.
15
+
16
+ BREAKING: `@atlaskit/tmp-editor-statsig` no longer defines the `platform_synced_block` editor
17
+ experiment. Consumers that use `editorExperiment('platform_synced_block', ...)` to conditionally
18
+ enable synced-block integrations will no longer be able to look up that experiment; synced-block
19
+ integrations are now enabled by default. Remove each lookup and its conditional branch:
20
+
21
+ ```ts
22
+ // Before
23
+ if (editorExperiment('platform_synced_block', true)) {
24
+ enableSyncedBlocks();
25
+ }
26
+
27
+ // After
28
+ enableSyncedBlocks();
29
+ ```
30
+
31
+ - Updated dependencies
32
+
3
33
  ## 16.0.3
4
34
 
5
35
  ### Patch Changes
@@ -437,7 +437,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
437
437
 
438
438
  // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
439
439
  // Hence strip out the mark for now
440
- if (destNode.type.name === 'bodiedSyncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
440
+ if (destNode.type.name === 'bodiedSyncBlock') {
441
441
  var _convertedNodeSlice2;
442
442
  var nodes = [];
443
443
  (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 || _convertedNodeSlice2.content.forEach(function (node) {
@@ -10,7 +10,6 @@ var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
12
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
14
13
  var _analytics2 = require("../pm-plugins/utils/analytics");
15
14
  var _checkFragment = require("../pm-plugins/utils/check-fragment");
16
15
  var _consts = require("../pm-plugins/utils/consts");
@@ -116,7 +115,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
116
115
  }
117
116
  var $to = tr.doc.resolve(to);
118
117
  var allowedParentTypes = [doc, layoutSection];
119
- if (bodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
118
+ if (bodiedSyncBlock) {
120
119
  allowedParentTypes.push(bodiedSyncBlock);
121
120
  }
122
121
 
@@ -30,7 +30,7 @@ var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutC
30
30
  var NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
31
31
  var UNSUPPORTED_LAYOUT_CONTENT = ['syncBlock', 'bodiedSyncBlock'];
32
32
  var getContainerNodeTypes = (0, _memoizeOne.default)(function () {
33
- return [].concat(PARENT_WITH_END_DROP_TARGET, (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), (0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_synced_block', true) ? ['bodiedSyncBlock'] : []));
33
+ return [].concat(PARENT_WITH_END_DROP_TARGET, (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ['bodiedSyncBlock']);
34
34
  });
35
35
  var isContainerNode = function isContainerNode(node) {
36
36
  var nodeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(node.type) : node.type.name;
@@ -213,29 +213,25 @@ var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = fu
213
213
  }
214
214
  var anchorEmitNodeWithPos = rootNodeWithPos;
215
215
  if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
216
- if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
217
- var schema = rootNodeWithPos.node.type.schema;
218
- var layoutSection = schema.nodes.layoutSection;
219
- var isLayoutSectionChildOfRoot = (0, _utils2.findChildrenByType)(rootNodeWithPos.node, layoutSection, false).length > 0;
220
- if (isLayoutSectionChildOfRoot) {
221
- // if node has layoutSection as a child, get the layoutSection node and pos
222
- for (var ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
223
- if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
224
- anchorEmitNodeWithPos = {
225
- node: $toPos.node(ancestorDepth),
226
- pos: $toPos.before(ancestorDepth)
227
- };
228
- break;
229
- }
216
+ var schema = rootNodeWithPos.node.type.schema;
217
+ var layoutSection = schema.nodes.layoutSection;
218
+ var isLayoutSectionChildOfRoot = (0, _utils2.findChildrenByType)(rootNodeWithPos.node, layoutSection, false).length > 0;
219
+ if (isLayoutSectionChildOfRoot) {
220
+ // if node has layoutSection as a child, get the layoutSection node and pos
221
+ for (var ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
222
+ if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
223
+ anchorEmitNodeWithPos = {
224
+ node: $toPos.node(ancestorDepth),
225
+ pos: $toPos.before(ancestorDepth)
226
+ };
227
+ break;
230
228
  }
231
- } else {
232
- anchorEmitNodeWithPos = rootNodeWithPos;
233
229
  }
234
230
  } else {
235
231
  anchorEmitNodeWithPos = rootNodeWithPos;
236
232
  }
237
233
  var _isSameLayout = $activeNodePos && (0, _validation.isInSameLayout)($activeNodePos, state.doc.resolve(anchorEmitNodeWithPos.pos));
238
- var hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') && (0, _experiments.editorExperiment)('platform_synced_block', true);
234
+ var hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '');
239
235
  if (anchorEmitNodeWithPos.node.type.name === 'layoutSection' && !hasUnsupportedContent) {
240
236
  var layoutSectionNode = anchorEmitNodeWithPos.node;
241
237
  if (layoutSectionNode.childCount < (0, _consts.maxLayoutColumnSupported)() || _isSameLayout) {
@@ -28,7 +28,7 @@ var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'lis
28
28
  var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
29
29
  var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
30
30
  var getParentTypesWithEndDropTarget = (0, _memoizeOne.default)(function () {
31
- return [].concat(PARENT_WITH_END_DROP_TARGET, (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), (0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_synced_block', true) ? ['bodiedSyncBlock'] : []));
31
+ return [].concat(PARENT_WITH_END_DROP_TARGET, (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ['bodiedSyncBlock']);
32
32
  });
33
33
  var shouldDescend = function shouldDescend(node) {
34
34
  return !['mediaSingle', 'paragraph', 'heading'].includes(node.type.name);
@@ -50,11 +50,10 @@ var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
50
50
  return true;
51
51
  };
52
52
  var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
53
- var isSyncBlockOffsetPatchEnabled = (0, _experiments.editorExperiment)('platform_synced_block', true);
54
53
  if (!prevNode && nextNode) {
55
54
  // first node - adjust for bodied containers
56
55
  var _offset = 0;
57
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
56
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
58
57
  _offset += 4;
59
58
  }
60
59
  return {
@@ -64,7 +63,7 @@ var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
64
63
  } else if (prevNode && !nextNode) {
65
64
  // last node - adjust for bodied containers
66
65
  var _offset2 = 0;
67
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
66
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
68
67
  _offset2 -= 4;
69
68
  }
70
69
  return {
@@ -830,7 +830,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
830
830
  isDragging: (_meta$isDragging3 = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging3 !== void 0 ? _meta$isDragging3 : isDragging,
831
831
  isMenuOpen: isMenuOpenNew,
832
832
  menuTriggerBy: flags.toolbarFlagsEnabled || (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? (meta === null || meta === void 0 || (_meta$toggleMenu = meta.toggleMenu) === null || _meta$toggleMenu === void 0 ? void 0 : _meta$toggleMenu.anchorName) || menuTriggerBy : undefined,
833
- menuTriggerByNode: (0, _experiments.editorExperiment)('platform_synced_block', true) ? (meta === null || meta === void 0 || (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode : undefined,
833
+ menuTriggerByNode: (meta === null || meta === void 0 || (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode,
834
834
  blockMenuOptions: (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? {
835
835
  canMoveUp: (meta === null || meta === void 0 || (_meta$toggleMenu3 = meta.toggleMenu) === null || _meta$toggleMenu3 === void 0 ? void 0 : _meta$toggleMenu3.moveUp) !== undefined ? meta === null || meta === void 0 || (_meta$toggleMenu4 = meta.toggleMenu) === null || _meta$toggleMenu4 === void 0 ? void 0 : _meta$toggleMenu4.moveUp : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveUp,
836
836
  canMoveDown: (meta === null || meta === void 0 || (_meta$toggleMenu5 = meta.toggleMenu) === null || _meta$toggleMenu5 === void 0 ? void 0 : _meta$toggleMenu5.moveDown) !== undefined ? meta === null || meta === void 0 || (_meta$toggleMenu6 = meta.toggleMenu) === null || _meta$toggleMenu6 === void 0 ? void 0 : _meta$toggleMenu6.moveDown : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveDown,
@@ -16,7 +16,7 @@ var shouldAllowInlineDropTarget = exports.shouldAllowInlineDropTarget = function
16
16
  var isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
17
17
  if ((0, _experiments.editorExperiment)('advanced_layouts', false) || isNested) {
18
18
  // If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
19
- if (isInsideBodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
19
+ if (isInsideBodiedSyncBlock) {
20
20
  return true;
21
21
  }
22
22
  return false;
@@ -27,7 +27,7 @@ var shouldAllowInlineDropTarget = exports.shouldAllowInlineDropTarget = function
27
27
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
28
28
  return false;
29
29
  }
30
- if ((syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
30
+ if (syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) {
31
31
  return false;
32
32
  }
33
33
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
@@ -56,7 +56,6 @@ var QUICK_INSERT_DIMENSIONS = exports.QUICK_INSERT_DIMENSIONS = {
56
56
  };
57
57
  var QUICK_INSERT_LEFT_OFFSET = exports.QUICK_INSERT_LEFT_OFFSET = 16;
58
58
  var nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
59
- var breakoutResizableNodes = ['expand', 'layoutSection', 'codeBlock'];
60
59
  var dragHandleGap = exports.dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
61
60
  if (parentNodeType === 'syncBlock' || parentNodeType === 'bodiedSyncBlock') {
62
61
  return DRAG_HANDLE_SYNCED_BLOCK_GAP;
@@ -68,7 +67,7 @@ var dragHandleGap = exports.dragHandleGap = function dragHandleGap(nodeType, par
68
67
  if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_extensions')) {
69
68
  breakoutResizableNodesList = (0, _utils.getBreakoutResizableNodes)();
70
69
  } else {
71
- breakoutResizableNodesList = (0, _experiments.editorExperiment)('platform_synced_block', true) ? (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat((0, _toConsumableArray2.default)(_utils.breakoutResizableNodes), ['rule', 'panel']) : _utils.breakoutResizableNodes : (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(breakoutResizableNodes, ['rule', 'panel']) : breakoutResizableNodes;
70
+ breakoutResizableNodesList = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat((0, _toConsumableArray2.default)(_utils.breakoutResizableNodes), ['rule', 'panel']) : _utils.breakoutResizableNodes;
72
71
  }
73
72
  if ((0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
74
73
  if (nodeType === 'layoutSection') {
@@ -92,7 +91,7 @@ var rootElementGap = exports.rootElementGap = function rootElementGap(nodeType)
92
91
  if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_extensions')) {
93
92
  breakoutResizableNodesList = (0, _utils.getBreakoutResizableNodes)();
94
93
  } else {
95
- breakoutResizableNodesList = (0, _experiments.editorExperiment)('platform_synced_block', true) ? (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat((0, _toConsumableArray2.default)(_utils.breakoutResizableNodes), ['rule', 'panel']) : _utils.breakoutResizableNodes : (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(breakoutResizableNodes, ['rule', 'panel']) : breakoutResizableNodes;
94
+ breakoutResizableNodesList = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat((0, _toConsumableArray2.default)(_utils.breakoutResizableNodes), ['rule', 'panel']) : _utils.breakoutResizableNodes;
96
95
  }
97
96
  if (nodeTypeExcludeList.includes(nodeType) || (0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
98
97
  if (nodeType === 'layoutSection') {
@@ -551,11 +551,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref2) {
551
551
  api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
552
552
  anchorName: anchorName,
553
553
  openedViaKeyboard: false,
554
- triggerByNode: (0, _experiments.editorExperiment)('platform_synced_block', true) ? {
554
+ triggerByNode: {
555
555
  nodeType: nodeType,
556
556
  pos: startPos,
557
557
  rootPos: tr.doc.resolve(startPos).before(1)
558
- } : undefined
558
+ }
559
559
  })({
560
560
  tr: tr
561
561
  });
@@ -664,12 +664,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref2) {
664
664
  if (nodeType === 'layoutColumn' && (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true)) {
665
665
  tr.setMeta('toggleLayoutColumnMenu', buildToggleLayoutColumnMenuMeta(startPos, true));
666
666
  }
667
- var rootPos = (0, _experiments.editorExperiment)('platform_synced_block', true) ? tr.doc.resolve(startPos).before(1) : undefined;
668
- var triggerByNode = (0, _experiments.editorExperiment)('platform_synced_block', true) ? {
667
+ var triggerByNode = {
669
668
  nodeType: nodeType,
670
669
  pos: startPos,
671
- rootPos: rootPos
672
- } : undefined;
670
+ rootPos: tr.doc.resolve(startPos).before(1)
671
+ };
673
672
  api === null || api === void 0 || (_api$blockControls5 = api.blockControls) === null || _api$blockControls5 === void 0 || _api$blockControls5.commands.toggleBlockMenu({
674
673
  anchorName: anchorName,
675
674
  triggerByNode: triggerByNode,
@@ -108,7 +108,7 @@ var HoverZone = function HoverZone(_ref) {
108
108
  _useActiveAnchorTrack2 = (0, _slicedToArray2.default)(_useActiveAnchorTrack, 2),
109
109
  _isActive = _useActiveAnchorTrack2[0],
110
110
  setActiveAnchor = _useActiveAnchorTrack2[1];
111
- var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true);
111
+ var isInsideBodiedSyncBlock = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'bodiedSyncBlock';
112
112
  (0, _react.useEffect)(function () {
113
113
  if (ref.current) {
114
114
  return (0, _adapter.dropTargetForElements)({
@@ -438,7 +438,7 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
438
438
 
439
439
  // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
440
440
  // Hence strip out the mark for now
441
- if (destNode.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)) {
441
+ if (destNode.type.name === 'bodiedSyncBlock') {
442
442
  var _convertedNodeSlice2;
443
443
  const nodes = [];
444
444
  (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 ? void 0 : _convertedNodeSlice2.content.forEach(node => {
@@ -4,7 +4,6 @@ import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { attachMoveNodeAnalytics, fireInsertLayoutAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
9
8
  import { containsNodeOfType, isFragmentOfType } from '../pm-plugins/utils/check-fragment';
10
9
  import { maxLayoutColumnSupported } from '../pm-plugins/utils/consts';
@@ -115,7 +114,7 @@ const canMoveToLayout = (api, from, to, tr, moveNodeAtCursorPos) => {
115
114
  }
116
115
  const $to = tr.doc.resolve(to);
117
116
  const allowedParentTypes = [doc, layoutSection];
118
- if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
117
+ if (bodiedSyncBlock) {
119
118
  allowedParentTypes.push(bodiedSyncBlock);
120
119
  }
121
120
 
@@ -22,7 +22,7 @@ const PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layou
22
22
  */
23
23
  const NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
24
24
  const UNSUPPORTED_LAYOUT_CONTENT = ['syncBlock', 'bodiedSyncBlock'];
25
- const getContainerNodeTypes = memoizeOne(() => [...PARENT_WITH_END_DROP_TARGET, ...(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ...(editorExperiment('platform_synced_block', true) ? ['bodiedSyncBlock'] : [])]);
25
+ const getContainerNodeTypes = memoizeOne(() => [...PARENT_WITH_END_DROP_TARGET, ...(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), 'bodiedSyncBlock']);
26
26
  const isContainerNode = node => {
27
27
  const nodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(node.type) : node.type.name;
28
28
  return getContainerNodeTypes().includes(nodeName);
@@ -192,31 +192,27 @@ export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api,
192
192
  }
193
193
  let anchorEmitNodeWithPos = rootNodeWithPos;
194
194
  if (editorExperiment('advanced_layouts', true)) {
195
- if (editorExperiment('platform_synced_block', true)) {
196
- const schema = rootNodeWithPos.node.type.schema;
197
- const {
198
- layoutSection
199
- } = schema.nodes;
200
- const isLayoutSectionChildOfRoot = findChildrenByType(rootNodeWithPos.node, layoutSection, false).length > 0;
201
- if (isLayoutSectionChildOfRoot) {
202
- // if node has layoutSection as a child, get the layoutSection node and pos
203
- for (let ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
204
- if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
205
- anchorEmitNodeWithPos = {
206
- node: $toPos.node(ancestorDepth),
207
- pos: $toPos.before(ancestorDepth)
208
- };
209
- break;
210
- }
195
+ const schema = rootNodeWithPos.node.type.schema;
196
+ const {
197
+ layoutSection
198
+ } = schema.nodes;
199
+ const isLayoutSectionChildOfRoot = findChildrenByType(rootNodeWithPos.node, layoutSection, false).length > 0;
200
+ if (isLayoutSectionChildOfRoot) {
201
+ // if node has layoutSection as a child, get the layoutSection node and pos
202
+ for (let ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
203
+ if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
204
+ anchorEmitNodeWithPos = {
205
+ node: $toPos.node(ancestorDepth),
206
+ pos: $toPos.before(ancestorDepth)
207
+ };
208
+ break;
211
209
  }
212
- } else {
213
- anchorEmitNodeWithPos = rootNodeWithPos;
214
210
  }
215
211
  } else {
216
212
  anchorEmitNodeWithPos = rootNodeWithPos;
217
213
  }
218
214
  const isSameLayout = $activeNodePos && isInSameLayout($activeNodePos, state.doc.resolve(anchorEmitNodeWithPos.pos));
219
- const hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') && editorExperiment('platform_synced_block', true);
215
+ const hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '');
220
216
  if (anchorEmitNodeWithPos.node.type.name === 'layoutSection' && !hasUnsupportedContent) {
221
217
  const layoutSectionNode = anchorEmitNodeWithPos.node;
222
218
  if (layoutSectionNode.childCount < maxLayoutColumnSupported() || isSameLayout) {
@@ -17,7 +17,7 @@ import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils
17
17
  const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'listItem', 'caption'];
18
18
  const PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
19
19
  const DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
20
- const getParentTypesWithEndDropTarget = memoizeOne(() => [...PARENT_WITH_END_DROP_TARGET, ...(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ...(editorExperiment('platform_synced_block', true) ? ['bodiedSyncBlock'] : [])]);
20
+ const getParentTypesWithEndDropTarget = memoizeOne(() => [...PARENT_WITH_END_DROP_TARGET, ...(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), 'bodiedSyncBlock']);
21
21
  const shouldDescend = node => {
22
22
  return !['mediaSingle', 'paragraph', 'heading'].includes(node.type.name);
23
23
  };
@@ -38,11 +38,10 @@ const shouldCollapseMargin = (prevNode, nextNode) => {
38
38
  return true;
39
39
  };
40
40
  const getGapAndOffset = (prevNode, nextNode, parentNode) => {
41
- const isSyncBlockOffsetPatchEnabled = editorExperiment('platform_synced_block', true);
42
41
  if (!prevNode && nextNode) {
43
42
  // first node - adjust for bodied containers
44
43
  let offset = 0;
45
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
44
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
46
45
  offset += 4;
47
46
  }
48
47
  return {
@@ -52,7 +51,7 @@ const getGapAndOffset = (prevNode, nextNode, parentNode) => {
52
51
  } else if (prevNode && !nextNode) {
53
52
  // last node - adjust for bodied containers
54
53
  let offset = 0;
55
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
54
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
56
55
  offset -= 4;
57
56
  }
58
57
  return {
@@ -731,7 +731,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
731
731
  isDragging: (_meta$isDragging3 = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging3 !== void 0 ? _meta$isDragging3 : isDragging,
732
732
  isMenuOpen: isMenuOpenNew,
733
733
  menuTriggerBy: flags.toolbarFlagsEnabled || editorExperiment('platform_editor_block_menu', true) ? (meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu = meta.toggleMenu) === null || _meta$toggleMenu === void 0 ? void 0 : _meta$toggleMenu.anchorName) || menuTriggerBy : undefined,
734
- menuTriggerByNode: editorExperiment('platform_synced_block', true) ? (meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode : undefined,
734
+ menuTriggerByNode: (meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode,
735
735
  blockMenuOptions: editorExperiment('platform_editor_block_menu', true) ? {
736
736
  canMoveUp: (meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu3 = meta.toggleMenu) === null || _meta$toggleMenu3 === void 0 ? void 0 : _meta$toggleMenu3.moveUp) !== undefined ? meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu4 = meta.toggleMenu) === null || _meta$toggleMenu4 === void 0 ? void 0 : _meta$toggleMenu4.moveUp : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveUp,
737
737
  canMoveDown: (meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu5 = meta.toggleMenu) === null || _meta$toggleMenu5 === void 0 ? void 0 : _meta$toggleMenu5.moveDown) !== undefined ? meta === null || meta === void 0 ? void 0 : (_meta$toggleMenu6 = meta.toggleMenu) === null || _meta$toggleMenu6 === void 0 ? void 0 : _meta$toggleMenu6.moveDown : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveDown,
@@ -11,7 +11,7 @@ isSameLayout = false, activeNode, parentNode) => {
11
11
  const isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
12
12
  if (editorExperiment('advanced_layouts', false) || isNested) {
13
13
  // If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
14
- if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
14
+ if (isInsideBodiedSyncBlock) {
15
15
  return true;
16
16
  }
17
17
  return false;
@@ -22,7 +22,7 @@ isSameLayout = false, activeNode, parentNode) => {
22
22
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
23
23
  return false;
24
24
  }
25
- if ((syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) && editorExperiment('platform_synced_block', true)) {
25
+ if (syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) {
26
26
  return false;
27
27
  }
28
28
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
@@ -46,7 +46,6 @@ export const QUICK_INSERT_DIMENSIONS = {
46
46
  };
47
47
  export const QUICK_INSERT_LEFT_OFFSET = 16;
48
48
  const nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
49
- const breakoutResizableNodes = ['expand', 'layoutSection', 'codeBlock'];
50
49
  export const dragHandleGap = (nodeType, parentNodeType) => {
51
50
  if (parentNodeType === 'syncBlock' || parentNodeType === 'bodiedSyncBlock') {
52
51
  return DRAG_HANDLE_SYNCED_BLOCK_GAP;
@@ -58,7 +57,7 @@ export const dragHandleGap = (nodeType, parentNodeType) => {
58
57
  if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
59
58
  breakoutResizableNodesList = getBreakoutResizableNodes();
60
59
  } else {
61
- breakoutResizableNodesList = editorExperiment('platform_synced_block', true) ? expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodesNew, 'rule', 'panel'] : breakoutResizableNodesNew : expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodes, 'rule', 'panel'] : breakoutResizableNodes;
60
+ breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodesNew, 'rule', 'panel'] : breakoutResizableNodesNew;
62
61
  }
63
62
  if (editorExperiment('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
64
63
  if (nodeType === 'layoutSection') {
@@ -82,7 +81,7 @@ export const rootElementGap = nodeType => {
82
81
  if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
83
82
  breakoutResizableNodesList = getBreakoutResizableNodes();
84
83
  } else {
85
- breakoutResizableNodesList = editorExperiment('platform_synced_block', true) ? expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodesNew, 'rule', 'panel'] : breakoutResizableNodesNew : expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodes, 'rule', 'panel'] : breakoutResizableNodes;
84
+ breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodesNew, 'rule', 'panel'] : breakoutResizableNodesNew;
86
85
  }
87
86
  if (nodeTypeExcludeList.includes(nodeType) || editorExperiment('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
88
87
  if (nodeType === 'layoutSection') {
@@ -525,11 +525,11 @@ export const DragHandle = ({
525
525
  api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.toggleBlockMenu({
526
526
  anchorName,
527
527
  openedViaKeyboard: false,
528
- triggerByNode: editorExperiment('platform_synced_block', true) ? {
528
+ triggerByNode: {
529
529
  nodeType,
530
530
  pos: startPos,
531
531
  rootPos: tr.doc.resolve(startPos).before(1)
532
- } : undefined
532
+ }
533
533
  })({
534
534
  tr
535
535
  });
@@ -639,12 +639,11 @@ export const DragHandle = ({
639
639
  if (nodeType === 'layoutColumn' && expValEquals('platform_editor_layout_column_menu', 'isEnabled', true)) {
640
640
  tr.setMeta('toggleLayoutColumnMenu', buildToggleLayoutColumnMenuMeta(startPos, true));
641
641
  }
642
- const rootPos = editorExperiment('platform_synced_block', true) ? tr.doc.resolve(startPos).before(1) : undefined;
643
- const triggerByNode = editorExperiment('platform_synced_block', true) ? {
642
+ const triggerByNode = {
644
643
  nodeType,
645
644
  pos: startPos,
646
- rootPos
647
- } : undefined;
645
+ rootPos: tr.doc.resolve(startPos).before(1)
646
+ };
648
647
  api === null || api === void 0 ? void 0 : (_api$blockControls5 = api.blockControls) === null || _api$blockControls5 === void 0 ? void 0 : _api$blockControls5.commands.toggleBlockMenu({
649
648
  anchorName,
650
649
  triggerByNode,
@@ -95,7 +95,7 @@ const HoverZone = ({
95
95
  return node ? getNodeAnchor(node) : '';
96
96
  }, [api, node, pos, position]);
97
97
  const [_isActive, setActiveAnchor] = useActiveAnchorTracker(anchorName);
98
- const isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true);
98
+ const isInsideBodiedSyncBlock = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'bodiedSyncBlock';
99
99
  useEffect(() => {
100
100
  if (ref.current) {
101
101
  return dropTargetForElements({
@@ -431,7 +431,7 @@ export var moveNode = function moveNode(api) {
431
431
 
432
432
  // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
433
433
  // Hence strip out the mark for now
434
- if (destNode.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)) {
434
+ if (destNode.type.name === 'bodiedSyncBlock') {
435
435
  var _convertedNodeSlice2;
436
436
  var nodes = [];
437
437
  (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 || _convertedNodeSlice2.content.forEach(function (node) {
@@ -4,7 +4,6 @@ import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { attachMoveNodeAnalytics, fireInsertLayoutAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
9
8
  import { containsNodeOfType, isFragmentOfType } from '../pm-plugins/utils/check-fragment';
10
9
  import { maxLayoutColumnSupported } from '../pm-plugins/utils/consts';
@@ -110,7 +109,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
110
109
  }
111
110
  var $to = tr.doc.resolve(to);
112
111
  var allowedParentTypes = [doc, layoutSection];
113
- if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
112
+ if (bodiedSyncBlock) {
114
113
  allowedParentTypes.push(bodiedSyncBlock);
115
114
  }
116
115
 
@@ -24,7 +24,7 @@ var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutC
24
24
  var NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
25
25
  var UNSUPPORTED_LAYOUT_CONTENT = ['syncBlock', 'bodiedSyncBlock'];
26
26
  var getContainerNodeTypes = memoizeOne(function () {
27
- return [].concat(PARENT_WITH_END_DROP_TARGET, _toConsumableArray(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), _toConsumableArray(editorExperiment('platform_synced_block', true) ? ['bodiedSyncBlock'] : []));
27
+ return [].concat(PARENT_WITH_END_DROP_TARGET, _toConsumableArray(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ['bodiedSyncBlock']);
28
28
  });
29
29
  var isContainerNode = function isContainerNode(node) {
30
30
  var nodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(node.type) : node.type.name;
@@ -207,29 +207,25 @@ export var getActiveDropTargetDecorations = function getActiveDropTargetDecorati
207
207
  }
208
208
  var anchorEmitNodeWithPos = rootNodeWithPos;
209
209
  if (editorExperiment('advanced_layouts', true)) {
210
- if (editorExperiment('platform_synced_block', true)) {
211
- var schema = rootNodeWithPos.node.type.schema;
212
- var layoutSection = schema.nodes.layoutSection;
213
- var isLayoutSectionChildOfRoot = findChildrenByType(rootNodeWithPos.node, layoutSection, false).length > 0;
214
- if (isLayoutSectionChildOfRoot) {
215
- // if node has layoutSection as a child, get the layoutSection node and pos
216
- for (var ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
217
- if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
218
- anchorEmitNodeWithPos = {
219
- node: $toPos.node(ancestorDepth),
220
- pos: $toPos.before(ancestorDepth)
221
- };
222
- break;
223
- }
210
+ var schema = rootNodeWithPos.node.type.schema;
211
+ var layoutSection = schema.nodes.layoutSection;
212
+ var isLayoutSectionChildOfRoot = findChildrenByType(rootNodeWithPos.node, layoutSection, false).length > 0;
213
+ if (isLayoutSectionChildOfRoot) {
214
+ // if node has layoutSection as a child, get the layoutSection node and pos
215
+ for (var ancestorDepth = $toPos.depth; ancestorDepth >= 1; ancestorDepth--) {
216
+ if ($toPos.node(ancestorDepth).type.name === 'layoutSection') {
217
+ anchorEmitNodeWithPos = {
218
+ node: $toPos.node(ancestorDepth),
219
+ pos: $toPos.before(ancestorDepth)
220
+ };
221
+ break;
224
222
  }
225
- } else {
226
- anchorEmitNodeWithPos = rootNodeWithPos;
227
223
  }
228
224
  } else {
229
225
  anchorEmitNodeWithPos = rootNodeWithPos;
230
226
  }
231
227
  var _isSameLayout = $activeNodePos && isInSameLayout($activeNodePos, state.doc.resolve(anchorEmitNodeWithPos.pos));
232
- var hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') && editorExperiment('platform_synced_block', true);
228
+ var hasUnsupportedContent = UNSUPPORTED_LAYOUT_CONTENT.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '');
233
229
  if (anchorEmitNodeWithPos.node.type.name === 'layoutSection' && !hasUnsupportedContent) {
234
230
  var layoutSectionNode = anchorEmitNodeWithPos.node;
235
231
  if (layoutSectionNode.childCount < maxLayoutColumnSupported() || _isSameLayout) {
@@ -22,7 +22,7 @@ var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'lis
22
22
  var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
23
23
  var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
24
24
  var getParentTypesWithEndDropTarget = memoizeOne(function () {
25
- return [].concat(PARENT_WITH_END_DROP_TARGET, _toConsumableArray(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), _toConsumableArray(editorExperiment('platform_synced_block', true) ? ['bodiedSyncBlock'] : []));
25
+ return [].concat(PARENT_WITH_END_DROP_TARGET, _toConsumableArray(expValEquals('confluence_native_tabs_experiment', 'isEnabled', true) ? ['multiBodiedExtension'] : []), ['bodiedSyncBlock']);
26
26
  });
27
27
  var shouldDescend = function shouldDescend(node) {
28
28
  return !['mediaSingle', 'paragraph', 'heading'].includes(node.type.name);
@@ -44,11 +44,10 @@ var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
44
44
  return true;
45
45
  };
46
46
  var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
47
- var isSyncBlockOffsetPatchEnabled = editorExperiment('platform_synced_block', true);
48
47
  if (!prevNode && nextNode) {
49
48
  // first node - adjust for bodied containers
50
49
  var _offset = 0;
51
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
50
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
52
51
  _offset += 4;
53
52
  }
54
53
  return {
@@ -58,7 +57,7 @@ var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
58
57
  } else if (prevNode && !nextNode) {
59
58
  // last node - adjust for bodied containers
60
59
  var _offset2 = 0;
61
- if (isSyncBlockOffsetPatchEnabled && parentNode !== null && parentNode !== void 0 && parentNode.type.name && parentNode.type.name === 'bodiedSyncBlock') {
60
+ if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock') {
62
61
  _offset2 -= 4;
63
62
  }
64
63
  return {
@@ -823,7 +823,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
823
823
  isDragging: (_meta$isDragging3 = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging3 !== void 0 ? _meta$isDragging3 : isDragging,
824
824
  isMenuOpen: isMenuOpenNew,
825
825
  menuTriggerBy: flags.toolbarFlagsEnabled || editorExperiment('platform_editor_block_menu', true) ? (meta === null || meta === void 0 || (_meta$toggleMenu = meta.toggleMenu) === null || _meta$toggleMenu === void 0 ? void 0 : _meta$toggleMenu.anchorName) || menuTriggerBy : undefined,
826
- menuTriggerByNode: editorExperiment('platform_synced_block', true) ? (meta === null || meta === void 0 || (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode : undefined,
826
+ menuTriggerByNode: (meta === null || meta === void 0 || (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.triggerByNode) || menuTriggerByNode,
827
827
  blockMenuOptions: editorExperiment('platform_editor_block_menu', true) ? {
828
828
  canMoveUp: (meta === null || meta === void 0 || (_meta$toggleMenu3 = meta.toggleMenu) === null || _meta$toggleMenu3 === void 0 ? void 0 : _meta$toggleMenu3.moveUp) !== undefined ? meta === null || meta === void 0 || (_meta$toggleMenu4 = meta.toggleMenu) === null || _meta$toggleMenu4 === void 0 ? void 0 : _meta$toggleMenu4.moveUp : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveUp,
829
829
  canMoveDown: (meta === null || meta === void 0 || (_meta$toggleMenu5 = meta.toggleMenu) === null || _meta$toggleMenu5 === void 0 ? void 0 : _meta$toggleMenu5.moveDown) !== undefined ? meta === null || meta === void 0 || (_meta$toggleMenu6 = meta.toggleMenu) === null || _meta$toggleMenu6 === void 0 ? void 0 : _meta$toggleMenu6.moveDown : blockMenuOptions === null || blockMenuOptions === void 0 ? void 0 : blockMenuOptions.canMoveDown,
@@ -10,7 +10,7 @@ export var shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(is
10
10
  var isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
11
11
  if (editorExperiment('advanced_layouts', false) || isNested) {
12
12
  // If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
13
- if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
13
+ if (isInsideBodiedSyncBlock) {
14
14
  return true;
15
15
  }
16
16
  return false;
@@ -21,7 +21,7 @@ export var shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(is
21
21
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
22
22
  return false;
23
23
  }
24
- if ((syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) && editorExperiment('platform_synced_block', true)) {
24
+ if (syncedBlockTypes.includes((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) || '') || syncedBlockTypes.includes((node === null || node === void 0 ? void 0 : node.type.name) || '')) {
25
25
  return false;
26
26
  }
27
27
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
@@ -49,7 +49,6 @@ export var QUICK_INSERT_DIMENSIONS = {
49
49
  };
50
50
  export var QUICK_INSERT_LEFT_OFFSET = 16;
51
51
  var nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
52
- var breakoutResizableNodes = ['expand', 'layoutSection', 'codeBlock'];
53
52
  export var dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
54
53
  if (parentNodeType === 'syncBlock' || parentNodeType === 'bodiedSyncBlock') {
55
54
  return DRAG_HANDLE_SYNCED_BLOCK_GAP;
@@ -61,7 +60,7 @@ export var dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
61
60
  if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
62
61
  breakoutResizableNodesList = getBreakoutResizableNodes();
63
62
  } else {
64
- breakoutResizableNodesList = editorExperiment('platform_synced_block', true) ? expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodesNew), ['rule', 'panel']) : breakoutResizableNodesNew : expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(breakoutResizableNodes, ['rule', 'panel']) : breakoutResizableNodes;
63
+ breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodesNew), ['rule', 'panel']) : breakoutResizableNodesNew;
65
64
  }
66
65
  if (editorExperiment('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
67
66
  if (nodeType === 'layoutSection') {
@@ -85,7 +84,7 @@ export var rootElementGap = function rootElementGap(nodeType) {
85
84
  if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
86
85
  breakoutResizableNodesList = getBreakoutResizableNodes();
87
86
  } else {
88
- breakoutResizableNodesList = editorExperiment('platform_synced_block', true) ? expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodesNew), ['rule', 'panel']) : breakoutResizableNodesNew : expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(breakoutResizableNodes, ['rule', 'panel']) : breakoutResizableNodes;
87
+ breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodesNew), ['rule', 'panel']) : breakoutResizableNodesNew;
89
88
  }
90
89
  if (nodeTypeExcludeList.includes(nodeType) || editorExperiment('platform_editor_breakout_resizing', true) && breakoutResizableNodesList.includes(nodeType)) {
91
90
  if (nodeType === 'layoutSection') {
@@ -547,11 +547,11 @@ export var DragHandle = function DragHandle(_ref2) {
547
547
  api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
548
548
  anchorName: anchorName,
549
549
  openedViaKeyboard: false,
550
- triggerByNode: editorExperiment('platform_synced_block', true) ? {
550
+ triggerByNode: {
551
551
  nodeType: nodeType,
552
552
  pos: startPos,
553
553
  rootPos: tr.doc.resolve(startPos).before(1)
554
- } : undefined
554
+ }
555
555
  })({
556
556
  tr: tr
557
557
  });
@@ -660,12 +660,11 @@ export var DragHandle = function DragHandle(_ref2) {
660
660
  if (nodeType === 'layoutColumn' && expValEquals('platform_editor_layout_column_menu', 'isEnabled', true)) {
661
661
  tr.setMeta('toggleLayoutColumnMenu', buildToggleLayoutColumnMenuMeta(startPos, true));
662
662
  }
663
- var rootPos = editorExperiment('platform_synced_block', true) ? tr.doc.resolve(startPos).before(1) : undefined;
664
- var triggerByNode = editorExperiment('platform_synced_block', true) ? {
663
+ var triggerByNode = {
665
664
  nodeType: nodeType,
666
665
  pos: startPos,
667
- rootPos: rootPos
668
- } : undefined;
666
+ rootPos: tr.doc.resolve(startPos).before(1)
667
+ };
669
668
  api === null || api === void 0 || (_api$blockControls5 = api.blockControls) === null || _api$blockControls5 === void 0 || _api$blockControls5.commands.toggleBlockMenu({
670
669
  anchorName: anchorName,
671
670
  triggerByNode: triggerByNode,
@@ -99,7 +99,7 @@ var HoverZone = function HoverZone(_ref) {
99
99
  _useActiveAnchorTrack2 = _slicedToArray(_useActiveAnchorTrack, 2),
100
100
  _isActive = _useActiveAnchorTrack2[0],
101
101
  setActiveAnchor = _useActiveAnchorTrack2[1];
102
- var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true);
102
+ var isInsideBodiedSyncBlock = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'bodiedSyncBlock';
103
103
  useEffect(function () {
104
104
  if (ref.current) {
105
105
  return dropTargetForElements({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "16.0.3",
3
+ "version": "16.0.5",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,7 +21,7 @@
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
23
  "@atlaskit/browser-apis": "^1.2.0",
24
- "@atlaskit/button": "^25.0.0",
24
+ "@atlaskit/button": "^25.1.0",
25
25
  "@atlaskit/editor-plugin-accessibility-utils": "^15.0.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^15.0.0",
27
27
  "@atlaskit/editor-plugin-editor-disabled": "^15.0.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.1.0",
51
51
  "@atlaskit/primitives": "^22.2.0",
52
52
  "@atlaskit/theme": "^28.0.0",
53
- "@atlaskit/tmp-editor-statsig": "^148.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^150.0.0",
54
54
  "@atlaskit/tokens": "^16.7.0",
55
55
  "@atlaskit/tooltip": "^24.0.0",
56
56
  "@babel/runtime": "^7.0.0",
@@ -61,7 +61,7 @@
61
61
  "uuid": "^3.1.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@atlaskit/editor-common": "^119.5.0",
64
+ "@atlaskit/editor-common": "^119.9.0",
65
65
  "react": "^18.2.0 || ^19.2.0",
66
66
  "react-dom": "^18.2.0 || ^19.2.0",
67
67
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"