@atlaskit/editor-plugin-block-controls 34.0.0 → 34.0.3

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,30 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 34.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e96273d9ce7cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e96273d9ce7cc) -
8
+ Use the existing three-dot block menu icon for all block handles in the
9
+ platform_editor_block_menu_three_dot_icon experiment.
10
+ - Updated dependencies
11
+
12
+ ## 34.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
18
+ ## 34.0.1
19
+
20
+ ### Patch Changes
21
+
22
+ - [`9ab5a817ea01c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ab5a817ea01c) -
23
+ Clean up the `cc_maui_remix_button_hover_corridor` experiment, retaining the shipped
24
+ `isEnabled: true` Remix button hover corridor behaviour and removing the experiment from the
25
+ editor experiments config.
26
+ - Updated dependencies
27
+
3
28
  ## 34.0.0
4
29
 
5
30
  ### Patch Changes
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.handleMouseMove = exports.handleMouseLeave = exports.handleMouseEnter = void 0;
7
7
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
8
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
9
8
  var _handleMouseOver = require("../handle-mouse-over");
10
9
  var _commands = require("./commands");
11
10
  var _constants = require("./constants");
@@ -87,9 +86,7 @@ var classifyRightMarginPosition = function classifyRightMarginPosition(view, eve
87
86
  if (event.clientX <= found.rect.right) {
88
87
  return null;
89
88
  }
90
- return event.clientX > getRightMarginBoundary(view) && !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', true) ? {
91
- type: 'gap'
92
- } : {
89
+ return {
93
90
  type: 'active',
94
91
  block: found.block
95
92
  };
@@ -126,7 +123,7 @@ var processHoverSide = function processHoverSide(view, api) {
126
123
  // This is more reliable than bounds when controls are in portals outside the editor DOM.
127
124
  var rightEdgeElement = target === null || target === void 0 ? void 0 : target.closest(getRightControlSelector());
128
125
  if (rightEdgeElement) {
129
- if (state !== null && state !== void 0 && state.isMouseOut && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
126
+ if (state !== null && state !== void 0 && state.isMouseOut) {
130
127
  (0, _commands.mouseEnter)(view, 'right');
131
128
  return;
132
129
  }
@@ -154,11 +151,8 @@ var processHoverSide = function processHoverSide(view, api) {
154
151
  }, api);
155
152
  // mouseenter doesn't fire over the click overlay, so clear isMouseOut here to re-show.
156
153
  if (state !== null && state !== void 0 && state.isMouseOut) {
157
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
158
- (0, _commands.mouseEnter)(view, 'right');
159
- return;
160
- }
161
- (0, _commands.mouseEnter)(view);
154
+ (0, _commands.mouseEnter)(view, 'right');
155
+ return;
162
156
  }
163
157
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== 'right') {
164
158
  (0, _commands.setHoverSide)(view, 'right');
@@ -166,9 +160,9 @@ var processHoverSide = function processHoverSide(view, api) {
166
160
  return;
167
161
  }
168
162
 
169
- // Keep the existing fixed Rovo gap in the control cohort. The treatment uses explicitly marked
170
- // control surfaces instead, so the rest of the right margin remains hoverable.
171
- if ((marginZone === null || marginZone === void 0 ? void 0 : marginZone.type) === 'gap' || event.clientX > getRightMarginBoundary(view) && (!blockElement || !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', true))) {
163
+ // Explicitly marked control surfaces handle the Rovo area, so the rest of the right margin
164
+ // remains hoverable; only clear hover when past the boundary and not over a block.
165
+ if (event.clientX > getRightMarginBoundary(view) && !blockElement) {
172
166
  if (!(state !== null && state !== void 0 && state.isMouseOut)) {
173
167
  (0, _commands.clearHoverSide)(view);
174
168
  (0, _commands.mouseLeave)(view);
@@ -186,7 +180,7 @@ var processHoverSide = function processHoverSide(view, api) {
186
180
  var midpoint = (left + right) / 2;
187
181
  var nextHoverSide = event.clientX > midpoint ? 'right' : 'left';
188
182
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== nextHoverSide) {
189
- if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
183
+ if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS)) {
190
184
  (0, _commands.mouseEnter)(view, nextHoverSide);
191
185
  return;
192
186
  }
@@ -11,7 +11,6 @@ var _blockControlsSuppression = require("@atlaskit/editor-common/block-controls-
11
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
14
- var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
15
14
  var _constants = require("./constants");
16
15
  var _handleKeyDown = require("./handle-key-down");
17
16
  var _handleMouseMove = require("./handle-mouse-move");
@@ -128,22 +127,22 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
128
127
  mouseLeaveTimeoutId = null;
129
128
  }
130
129
 
131
- // Preserve the existing hover targets for the control cohort.
130
+ // Preserve hover while moving onto block controls or an active click area.
132
131
  if (rightSideControlsEnabled && (isMovingToBlockControlsArea(event.relatedTarget) || isOverActiveClickArea(event.relatedTarget, event.clientX))) {
133
132
  return;
134
133
  }
135
- if (rightSideControlsEnabled && (0, _isExperimentEnabled.isExperimentEnabled)('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
134
+ if (rightSideControlsEnabled && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
136
135
  return;
137
136
  }
138
137
  mouseLeaveTimeoutId = setTimeout(function () {
139
138
  mouseLeaveTimeoutId = null;
140
- // Re-check the control cohort's existing hover targets after the debounce.
139
+ // Re-check hover targets after the debounce.
141
140
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
142
141
  var el = document.elementFromPoint(lastMousePosition.x, lastMousePosition.y);
143
142
  if (el && (isMovingToBlockControlsArea(el) || isOverActiveClickArea(el, lastMousePosition.x))) {
144
143
  return;
145
144
  }
146
- if (el && (0, _isExperimentEnabled.isExperimentEnabled)('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
145
+ if (el && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
147
146
  return;
148
147
  }
149
148
  }
@@ -185,25 +184,13 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
185
184
  };
186
185
  if (editorContentArea) {
187
186
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
188
- // RemixButtonDecoration fires exposure when the control is visible; this
189
- // mount-time split only selects the appropriate interaction listener.
190
- if ((0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('cc_maui_remix_button_hover_corridor', 'isEnabled', false) === true) {
191
- unbindDocumentMouseMove = (0, _bindEventListener.bind)(document, {
192
- type: 'mousemove',
193
- listener: handleTreatmentDocumentMouseMove,
194
- options: {
195
- passive: true
196
- }
197
- });
198
- } else {
199
- unbindDocumentMouseMove = (0, _bindEventListener.bind)(document, {
200
- type: 'mousemove',
201
- listener: handleDocumentMouseMove,
202
- options: {
203
- passive: true
204
- }
205
- });
206
- }
187
+ unbindDocumentMouseMove = (0, _bindEventListener.bind)(document, {
188
+ type: 'mousemove',
189
+ listener: handleTreatmentDocumentMouseMove,
190
+ options: {
191
+ passive: true
192
+ }
193
+ });
207
194
  }
208
195
  unbindMouseEnter = (0, _bindEventListener.bind)(editorContentArea, {
209
196
  type: 'mouseenter',
@@ -28,7 +28,7 @@ var _collapsedHeading = require("../pm-plugins/utils/collapsed-heading");
28
28
  var _expandAndUpdateSelection = require("../pm-plugins/utils/expand-and-update-selection");
29
29
  var _getSelection = require("../pm-plugins/utils/getSelection");
30
30
  var _blockControlsSurfaceDragHandleUtils = require("./block-controls-surface-drag-handle-utils");
31
- var _dragHandleNestedIcon = require("./drag-handle-nested-icon");
31
+ var _dragHandleNarrowIcon = require("./drag-handle-narrow-icon");
32
32
  var _shouldUseNestedDragHandleIcon = require("./should-use-nested-drag-handle-icon");
33
33
  var _surfaceEditorViewContext = require("./surface-editor-view-context");
34
34
  var _useBlockControlsSurfaceDragSource = require("./use-block-controls-surface-drag-source");
@@ -284,7 +284,7 @@ var BlockControlsSurfaceDragHandle = exports.BlockControlsSurfaceDragHandle = fu
284
284
  }, /*#__PURE__*/React.createElement("span", {
285
285
  onDragStart: handleIconDragStart,
286
286
  className: (0, _runtime.ax)([dragHandleStyles.iconWrapper])
287
- }, (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(_dragHandleNestedIcon.DragHandleNestedIcon, null) : /*#__PURE__*/React.createElement(_dragHandleVertical.default, {
287
+ }, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_menu_three_dot_icon') || (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(_dragHandleNarrowIcon.DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(_dragHandleVertical.default, {
288
288
  label: "",
289
289
  size: "small",
290
290
  spacing: "spacious"
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DragHandleNestedIcon = void 0;
6
+ exports.DragHandleNarrowIcon = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  /** @jsxRuntime classic */
9
9
  /**
@@ -29,11 +29,11 @@ var svgStyles = (0, _react.css)({
29
29
  });
30
30
 
31
31
  /**
32
- * Custom 3-dot vertical drag handle icon for nested nodes.
32
+ * Custom 3-dot vertical drag handle icon.
33
33
  * Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
34
34
  * Hardcoded to medium size with spacious spacing.
35
35
  */
36
- var DragHandleNestedIcon = exports.DragHandleNestedIcon = function DragHandleNestedIcon() {
36
+ var DragHandleNarrowIcon = exports.DragHandleNarrowIcon = function DragHandleNarrowIcon() {
37
37
  return (0, _react.jsx)("span", {
38
38
  "aria-hidden": true,
39
39
  css: spanStyles
@@ -21,6 +21,7 @@ var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useShar
21
21
  var _utils = require("@atlaskit/editor-prosemirror/utils");
22
22
  var _constants = require("@atlaskit/editor-shared-styles/constants");
23
23
  var _dragHandleVertical = _interopRequireDefault(require("@atlaskit/icon/core/drag-handle-vertical"));
24
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
24
25
  var _fg = require("@atlaskit/platform-feature-flags/fg");
25
26
  var _elementAdapter = require("@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter");
26
27
  var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview");
@@ -38,7 +39,7 @@ var _dragHandlePositions = require("../pm-plugins/utils/drag-handle-positions");
38
39
  var _expandAndUpdateSelection = require("../pm-plugins/utils/expand-and-update-selection");
39
40
  var _getSelection = require("../pm-plugins/utils/getSelection");
40
41
  var _consts = require("./consts");
41
- var _dragHandleNestedIcon = require("./drag-handle-nested-icon");
42
+ var _dragHandleNarrowIcon = require("./drag-handle-narrow-icon");
42
43
  var _dragPreview = require("./drag-preview");
43
44
  var _shouldUseNestedDragHandleIcon = require("./should-use-nested-drag-handle-icon");
44
45
  var _anchorName = require("./utils/anchor-name");
@@ -940,7 +941,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref2) {
940
941
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
941
942
  ,
942
943
  onDragStart: handleIconDragStart
943
- }, (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(isTopLevelNodeValue, isLayoutColumn) ? (0, _react2.jsx)(_dragHandleNestedIcon.DragHandleNestedIcon, null) : (0, _react2.jsx)(_dragHandleVertical.default, {
944
+ }, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_menu_three_dot_icon') || (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(isTopLevelNodeValue, isLayoutColumn) ? (0, _react2.jsx)(_dragHandleNarrowIcon.DragHandleNarrowIcon, null) : (0, _react2.jsx)(_dragHandleVertical.default, {
944
945
  spacing: "spacious",
945
946
  label: "",
946
947
  size: "small"
@@ -1,5 +1,4 @@
1
1
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
3
2
  import { handleMouseOver } from '../handle-mouse-over';
4
3
  import { clearHoverSide, mouseEnter, mouseLeave, setHoverSide, stopEditing } from './commands';
5
4
  import { RIGHT_MARGIN_ROVO_GAP_PX } from './constants';
@@ -64,9 +63,7 @@ const classifyRightMarginPosition = (view, event) => {
64
63
  if (event.clientX <= found.rect.right) {
65
64
  return null;
66
65
  }
67
- return event.clientX > getRightMarginBoundary(view) && !expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true) ? {
68
- type: 'gap'
69
- } : {
66
+ return {
70
67
  type: 'active',
71
68
  block: found.block
72
69
  };
@@ -103,7 +100,7 @@ const processHoverSide = (view, api) => {
103
100
  // This is more reliable than bounds when controls are in portals outside the editor DOM.
104
101
  const rightEdgeElement = target === null || target === void 0 ? void 0 : target.closest(getRightControlSelector());
105
102
  if (rightEdgeElement) {
106
- if (state !== null && state !== void 0 && state.isMouseOut && expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
103
+ if (state !== null && state !== void 0 && state.isMouseOut) {
107
104
  mouseEnter(view, 'right');
108
105
  return;
109
106
  }
@@ -131,11 +128,8 @@ const processHoverSide = (view, api) => {
131
128
  }, api);
132
129
  // mouseenter doesn't fire over the click overlay, so clear isMouseOut here to re-show.
133
130
  if (state !== null && state !== void 0 && state.isMouseOut) {
134
- if (expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
135
- mouseEnter(view, 'right');
136
- return;
137
- }
138
- mouseEnter(view);
131
+ mouseEnter(view, 'right');
132
+ return;
139
133
  }
140
134
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== 'right') {
141
135
  setHoverSide(view, 'right');
@@ -143,9 +137,9 @@ const processHoverSide = (view, api) => {
143
137
  return;
144
138
  }
145
139
 
146
- // Keep the existing fixed Rovo gap in the control cohort. The treatment uses explicitly marked
147
- // control surfaces instead, so the rest of the right margin remains hoverable.
148
- if ((marginZone === null || marginZone === void 0 ? void 0 : marginZone.type) === 'gap' || event.clientX > getRightMarginBoundary(view) && (!blockElement || !expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true))) {
140
+ // Explicitly marked control surfaces handle the Rovo area, so the rest of the right margin
141
+ // remains hoverable; only clear hover when past the boundary and not over a block.
142
+ if (event.clientX > getRightMarginBoundary(view) && !blockElement) {
149
143
  if (!(state !== null && state !== void 0 && state.isMouseOut)) {
150
144
  clearHoverSide(view);
151
145
  mouseLeave(view);
@@ -164,7 +158,7 @@ const processHoverSide = (view, api) => {
164
158
  const midpoint = (left + right) / 2;
165
159
  const nextHoverSide = event.clientX > midpoint ? 'right' : 'left';
166
160
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== nextHoverSide) {
167
- if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS) && expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
161
+ if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS)) {
168
162
  mouseEnter(view, nextHoverSide);
169
163
  return;
170
164
  }
@@ -3,7 +3,6 @@ import { isBlockControlsSuppressionTarget } from '@atlaskit/editor-common/block-
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
5
5
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
- import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
7
6
  import { RIGHT_MARGIN_ROVO_GAP_PX } from './constants';
8
7
  import { handleKeyDown } from './handle-key-down';
9
8
  import { handleMouseEnter, handleMouseLeave, handleMouseMove } from './handle-mouse-move';
@@ -114,22 +113,22 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
114
113
  mouseLeaveTimeoutId = null;
115
114
  }
116
115
 
117
- // Preserve the existing hover targets for the control cohort.
116
+ // Preserve hover while moving onto block controls or an active click area.
118
117
  if (rightSideControlsEnabled && (isMovingToBlockControlsArea(event.relatedTarget) || isOverActiveClickArea(event.relatedTarget, event.clientX))) {
119
118
  return;
120
119
  }
121
- if (rightSideControlsEnabled && isExperimentEnabled('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
120
+ if (rightSideControlsEnabled && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
122
121
  return;
123
122
  }
124
123
  mouseLeaveTimeoutId = setTimeout(() => {
125
124
  mouseLeaveTimeoutId = null;
126
- // Re-check the control cohort's existing hover targets after the debounce.
125
+ // Re-check hover targets after the debounce.
127
126
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
128
127
  const el = document.elementFromPoint(lastMousePosition.x, lastMousePosition.y);
129
128
  if (el && (isMovingToBlockControlsArea(el) || isOverActiveClickArea(el, lastMousePosition.x))) {
130
129
  return;
131
130
  }
132
- if (el && isExperimentEnabled('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
131
+ if (el && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
133
132
  return;
134
133
  }
135
134
  }
@@ -171,25 +170,13 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
171
170
  };
172
171
  if (editorContentArea) {
173
172
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
174
- // RemixButtonDecoration fires exposure when the control is visible; this
175
- // mount-time split only selects the appropriate interaction listener.
176
- if (UNSAFE_expValNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', false) === true) {
177
- unbindDocumentMouseMove = bind(document, {
178
- type: 'mousemove',
179
- listener: handleTreatmentDocumentMouseMove,
180
- options: {
181
- passive: true
182
- }
183
- });
184
- } else {
185
- unbindDocumentMouseMove = bind(document, {
186
- type: 'mousemove',
187
- listener: handleDocumentMouseMove,
188
- options: {
189
- passive: true
190
- }
191
- });
192
- }
173
+ unbindDocumentMouseMove = bind(document, {
174
+ type: 'mousemove',
175
+ listener: handleTreatmentDocumentMouseMove,
176
+ options: {
177
+ passive: true
178
+ }
179
+ });
193
180
  }
194
181
  unbindMouseEnter = bind(editorContentArea, {
195
182
  type: 'mouseenter',
@@ -22,7 +22,7 @@ import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-
22
22
  import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
23
23
  import { isHandleCorrelatedToSelection } from '../pm-plugins/utils/getSelection';
24
24
  import { buildLayoutColumnMenuMeta } from './block-controls-surface-drag-handle-utils';
25
- import { DragHandleNestedIcon } from './drag-handle-nested-icon';
25
+ import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
26
26
  import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
27
27
  import { useSurfaceEditorView } from './surface-editor-view-context';
28
28
  import { useBlockControlsSurfaceDragSource } from './use-block-controls-surface-drag-source';
@@ -270,7 +270,7 @@ export const BlockControlsSurfaceDragHandle = ({
270
270
  }, /*#__PURE__*/React.createElement("span", {
271
271
  onDragStart: handleIconDragStart,
272
272
  className: ax([dragHandleStyles.iconWrapper])
273
- }, shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNestedIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
273
+ }, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
274
274
  label: "",
275
275
  size: "small",
276
276
  spacing: "spacious"
@@ -22,11 +22,11 @@ const svgStyles = css({
22
22
  });
23
23
 
24
24
  /**
25
- * Custom 3-dot vertical drag handle icon for nested nodes.
25
+ * Custom 3-dot vertical drag handle icon.
26
26
  * Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
27
27
  * Hardcoded to medium size with spacious spacing.
28
28
  */
29
- export const DragHandleNestedIcon = () => {
29
+ export const DragHandleNarrowIcon = () => {
30
30
  return jsx("span", {
31
31
  "aria-hidden": true,
32
32
  css: spanStyles
@@ -18,6 +18,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
18
18
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
19
19
  import { akEditorTableToolbarSize, relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
20
20
  import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
21
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
21
22
  import { fg } from '@atlaskit/platform-feature-flags/fg';
22
23
  import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
23
24
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
@@ -37,7 +38,7 @@ import { getControlBottomCSSValue, getControlHeightCSSValue, getLeftPosition, ge
37
38
  import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
38
39
  import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
39
40
  import { ACTIVE_DRAG_HANDLE_ATTR, ACTIVE_DRAG_HANDLE_FALLBACK_ANCHOR_NAME, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, STICKY_CONTROLS_TOP_MARGIN, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment } from './consts';
40
- import { DragHandleNestedIcon } from './drag-handle-nested-icon';
41
+ import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
41
42
  import { dragPreview } from './drag-preview';
42
43
  import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
43
44
  import { refreshAnchorName } from './utils/anchor-name';
@@ -921,7 +922,7 @@ export const DragHandle = ({
921
922
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
922
923
  ,
923
924
  onDragStart: handleIconDragStart
924
- }, shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNestedIcon, null) : jsx(DragHandleVerticalIcon, {
925
+ }, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNarrowIcon, null) : jsx(DragHandleVerticalIcon, {
925
926
  spacing: "spacious",
926
927
  label: "",
927
928
  size: "small"
@@ -2,7 +2,6 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
2
2
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
3
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
4
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
5
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
5
  import { handleMouseOver } from '../handle-mouse-over';
7
6
  import { clearHoverSide, mouseEnter, mouseLeave, setHoverSide, stopEditing } from './commands';
8
7
  import { RIGHT_MARGIN_ROVO_GAP_PX } from './constants';
@@ -82,9 +81,7 @@ var classifyRightMarginPosition = function classifyRightMarginPosition(view, eve
82
81
  if (event.clientX <= found.rect.right) {
83
82
  return null;
84
83
  }
85
- return event.clientX > getRightMarginBoundary(view) && !expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true) ? {
86
- type: 'gap'
87
- } : {
84
+ return {
88
85
  type: 'active',
89
86
  block: found.block
90
87
  };
@@ -121,7 +118,7 @@ var processHoverSide = function processHoverSide(view, api) {
121
118
  // This is more reliable than bounds when controls are in portals outside the editor DOM.
122
119
  var rightEdgeElement = target === null || target === void 0 ? void 0 : target.closest(getRightControlSelector());
123
120
  if (rightEdgeElement) {
124
- if (state !== null && state !== void 0 && state.isMouseOut && expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
121
+ if (state !== null && state !== void 0 && state.isMouseOut) {
125
122
  mouseEnter(view, 'right');
126
123
  return;
127
124
  }
@@ -149,11 +146,8 @@ var processHoverSide = function processHoverSide(view, api) {
149
146
  }, api);
150
147
  // mouseenter doesn't fire over the click overlay, so clear isMouseOut here to re-show.
151
148
  if (state !== null && state !== void 0 && state.isMouseOut) {
152
- if (expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
153
- mouseEnter(view, 'right');
154
- return;
155
- }
156
- mouseEnter(view);
149
+ mouseEnter(view, 'right');
150
+ return;
157
151
  }
158
152
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== 'right') {
159
153
  setHoverSide(view, 'right');
@@ -161,9 +155,9 @@ var processHoverSide = function processHoverSide(view, api) {
161
155
  return;
162
156
  }
163
157
 
164
- // Keep the existing fixed Rovo gap in the control cohort. The treatment uses explicitly marked
165
- // control surfaces instead, so the rest of the right margin remains hoverable.
166
- if ((marginZone === null || marginZone === void 0 ? void 0 : marginZone.type) === 'gap' || event.clientX > getRightMarginBoundary(view) && (!blockElement || !expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true))) {
158
+ // Explicitly marked control surfaces handle the Rovo area, so the rest of the right margin
159
+ // remains hoverable; only clear hover when past the boundary and not over a block.
160
+ if (event.clientX > getRightMarginBoundary(view) && !blockElement) {
167
161
  if (!(state !== null && state !== void 0 && state.isMouseOut)) {
168
162
  clearHoverSide(view);
169
163
  mouseLeave(view);
@@ -181,7 +175,7 @@ var processHoverSide = function processHoverSide(view, api) {
181
175
  var midpoint = (left + right) / 2;
182
176
  var nextHoverSide = event.clientX > midpoint ? 'right' : 'left';
183
177
  if ((state === null || state === void 0 ? void 0 : state.hoverSide) !== nextHoverSide) {
184
- if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS) && expValEqualsNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', true)) {
178
+ if (state !== null && state !== void 0 && state.isMouseOut && target !== null && target !== void 0 && target.closest(BLOCK_SELECTORS)) {
185
179
  mouseEnter(view, nextHoverSide);
186
180
  return;
187
181
  }
@@ -6,7 +6,6 @@ import { isBlockControlsSuppressionTarget } from '@atlaskit/editor-common/block-
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
7
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
8
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
9
- import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
10
9
  import { RIGHT_MARGIN_ROVO_GAP_PX } from './constants';
11
10
  import { handleKeyDown } from './handle-key-down';
12
11
  import { handleMouseEnter, handleMouseLeave, handleMouseMove } from './handle-mouse-move';
@@ -122,22 +121,22 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
122
121
  mouseLeaveTimeoutId = null;
123
122
  }
124
123
 
125
- // Preserve the existing hover targets for the control cohort.
124
+ // Preserve hover while moving onto block controls or an active click area.
126
125
  if (rightSideControlsEnabled && (isMovingToBlockControlsArea(event.relatedTarget) || isOverActiveClickArea(event.relatedTarget, event.clientX))) {
127
126
  return;
128
127
  }
129
- if (rightSideControlsEnabled && isExperimentEnabled('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
128
+ if (rightSideControlsEnabled && isOverTreatmentClickArea(event.relatedTarget, editorContentArea, event.clientX)) {
130
129
  return;
131
130
  }
132
131
  mouseLeaveTimeoutId = setTimeout(function () {
133
132
  mouseLeaveTimeoutId = null;
134
- // Re-check the control cohort's existing hover targets after the debounce.
133
+ // Re-check hover targets after the debounce.
135
134
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
136
135
  var el = document.elementFromPoint(lastMousePosition.x, lastMousePosition.y);
137
136
  if (el && (isMovingToBlockControlsArea(el) || isOverActiveClickArea(el, lastMousePosition.x))) {
138
137
  return;
139
138
  }
140
- if (el && isExperimentEnabled('cc_maui_remix_button_hover_corridor') && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
139
+ if (el && isOverTreatmentClickArea(el, editorContentArea, lastMousePosition.x)) {
141
140
  return;
142
141
  }
143
142
  }
@@ -179,25 +178,13 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
179
178
  };
180
179
  if (editorContentArea) {
181
180
  if (rightSideControlsEnabled && typeof document !== 'undefined') {
182
- // RemixButtonDecoration fires exposure when the control is visible; this
183
- // mount-time split only selects the appropriate interaction listener.
184
- if (UNSAFE_expValNoExposure('cc_maui_remix_button_hover_corridor', 'isEnabled', false) === true) {
185
- unbindDocumentMouseMove = bind(document, {
186
- type: 'mousemove',
187
- listener: handleTreatmentDocumentMouseMove,
188
- options: {
189
- passive: true
190
- }
191
- });
192
- } else {
193
- unbindDocumentMouseMove = bind(document, {
194
- type: 'mousemove',
195
- listener: handleDocumentMouseMove,
196
- options: {
197
- passive: true
198
- }
199
- });
200
- }
181
+ unbindDocumentMouseMove = bind(document, {
182
+ type: 'mousemove',
183
+ listener: handleTreatmentDocumentMouseMove,
184
+ options: {
185
+ passive: true
186
+ }
187
+ });
201
188
  }
202
189
  unbindMouseEnter = bind(editorContentArea, {
203
190
  type: 'mouseenter',
@@ -23,7 +23,7 @@ import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-
23
23
  import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
24
24
  import { isHandleCorrelatedToSelection } from '../pm-plugins/utils/getSelection';
25
25
  import { buildLayoutColumnMenuMeta } from './block-controls-surface-drag-handle-utils';
26
- import { DragHandleNestedIcon } from './drag-handle-nested-icon';
26
+ import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
27
27
  import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
28
28
  import { useSurfaceEditorView } from './surface-editor-view-context';
29
29
  import { useBlockControlsSurfaceDragSource } from './use-block-controls-surface-drag-source';
@@ -278,7 +278,7 @@ export var BlockControlsSurfaceDragHandle = function BlockControlsSurfaceDragHan
278
278
  }, /*#__PURE__*/React.createElement("span", {
279
279
  onDragStart: handleIconDragStart,
280
280
  className: ax([dragHandleStyles.iconWrapper])
281
- }, shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNestedIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
281
+ }, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
282
282
  label: "",
283
283
  size: "small",
284
284
  spacing: "spacious"
@@ -22,11 +22,11 @@ var svgStyles = css({
22
22
  });
23
23
 
24
24
  /**
25
- * Custom 3-dot vertical drag handle icon for nested nodes.
25
+ * Custom 3-dot vertical drag handle icon.
26
26
  * Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
27
27
  * Hardcoded to medium size with spacious spacing.
28
28
  */
29
- export var DragHandleNestedIcon = function DragHandleNestedIcon() {
29
+ export var DragHandleNarrowIcon = function DragHandleNarrowIcon() {
30
30
  return jsx("span", {
31
31
  "aria-hidden": true,
32
32
  css: spanStyles
@@ -22,6 +22,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
22
22
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
23
23
  import { akEditorTableToolbarSize, relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
24
24
  import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
25
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
25
26
  import { fg } from '@atlaskit/platform-feature-flags/fg';
26
27
  import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
27
28
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
@@ -41,7 +42,7 @@ import { getControlBottomCSSValue, getControlHeightCSSValue, getLeftPosition, ge
41
42
  import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
42
43
  import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
43
44
  import { ACTIVE_DRAG_HANDLE_ATTR, ACTIVE_DRAG_HANDLE_FALLBACK_ANCHOR_NAME, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, STICKY_CONTROLS_TOP_MARGIN, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment } from './consts';
44
- import { DragHandleNestedIcon } from './drag-handle-nested-icon';
45
+ import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
45
46
  import { dragPreview } from './drag-preview';
46
47
  import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
47
48
  import { refreshAnchorName } from './utils/anchor-name';
@@ -936,7 +937,7 @@ export var DragHandle = function DragHandle(_ref2) {
936
937
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
937
938
  ,
938
939
  onDragStart: handleIconDragStart
939
- }, shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNestedIcon, null) : jsx(DragHandleVerticalIcon, {
940
+ }, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNarrowIcon, null) : jsx(DragHandleVerticalIcon, {
940
941
  spacing: "spacious",
941
942
  label: "",
942
943
  size: "small"
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { jsx } from '@emotion/react';
7
7
  /**
8
- * Custom 3-dot vertical drag handle icon for nested nodes.
8
+ * Custom 3-dot vertical drag handle icon.
9
9
  * Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
10
10
  * Hardcoded to medium size with spacious spacing.
11
11
  */
12
- export declare const DragHandleNestedIcon: () => jsx.JSX.Element;
12
+ export declare const DragHandleNarrowIcon: () => jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "34.0.0",
3
+ "version": "34.0.3",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -57,11 +57,11 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
58
58
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
59
59
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.3.0",
60
- "@atlaskit/primitives": "^22.7.0",
60
+ "@atlaskit/primitives": "^22.8.0",
61
61
  "@atlaskit/section-message": "^10.3.0",
62
62
  "@atlaskit/theme": "^28.2.0",
63
- "@atlaskit/tmp-editor-statsig": "^264.0.0",
64
- "@atlaskit/tokens": "^20.12.0",
63
+ "@atlaskit/tmp-editor-statsig": "^266.0.0",
64
+ "@atlaskit/tokens": "^20.14.0",
65
65
  "@atlaskit/tooltip": "^24.4.0",
66
66
  "@babel/runtime": "^7.0.0",
67
67
  "@compiled/react": "^1.0.2",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^11.1.1"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^137.0.0",
75
+ "@atlaskit/editor-common": "^137.2.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -96,7 +96,10 @@
96
96
  }
97
97
  },
98
98
  "devDependencies": {
99
- "@atlaskit/editor-common": "^137.0.0",
99
+ "@af/editor-examples-helpers": "workspace:^",
100
+ "@atlaskit/editor-common": "^137.2.0",
101
+ "@atlaskit/editor-plugins": "^17.0.0",
102
+ "@atlaskit/synchrony-test-helpers": "workspace:^",
100
103
  "@atlassian/structured-docs-types": "workspace:^",
101
104
  "@atlassian/workbench": "workspace:*",
102
105
  "react": "^19.2.0",