@atlaskit/editor-plugin-block-controls 3.13.3 → 3.13.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,24 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 3.13.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#151363](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/151363)
8
+ [`ff30967c9ad78`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ff30967c9ad78) -
9
+ Revert destroy change for drag handle widgets
10
+ - [#150243](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150243)
11
+ [`860ff9fc6066c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/860ff9fc6066c) -
12
+ Remove FG platform_editor_controls_sticky_controls
13
+
14
+ ## 3.13.4
15
+
16
+ ### Patch Changes
17
+
18
+ - [#149231](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149231)
19
+ [`1c807d5c27e51`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c807d5c27e51) -
20
+ Fix cursor being hidden on empty lines in safari.
21
+
3
22
  ## 3.13.3
4
23
 
5
24
  ### Patch Changes
@@ -30,9 +30,7 @@ var findHandleDec = exports.findHandleDec = function findHandleDec(decorations,
30
30
  });
31
31
  };
32
32
  var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDecoration(api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) {
33
- if (!(0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
34
- (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
35
- }
33
+ (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
36
34
  var unbind;
37
35
  var key = (0, _uuid.default)();
38
36
  return _view.Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -123,12 +121,8 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
123
121
  side: -1,
124
122
  type: _decorationsCommon.TYPE_HANDLE_DEC,
125
123
  testid: "".concat(_decorationsCommon.TYPE_HANDLE_DEC, "-").concat((0, _uuid.default)()),
126
- destroy: function destroy(node) {
124
+ destroy: function destroy(_) {
127
125
  unbind && unbind();
128
- if ((0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
129
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
130
- _reactDom.default.unmountComponentAtNode(node);
131
- }
132
126
  }
133
127
  });
134
128
  };
@@ -659,7 +659,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
659
659
  var _api$core2;
660
660
  var isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest("#".concat(_ui.EDIT_AREA_ID)) !== null;
661
661
 
662
- // don't do anything if the event target is a child of the editor or if the editor has focus
662
+ // don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
663
+ // or if the editor has focus
663
664
  if (isChildOfEditor || view.hasFocus()) {
664
665
  return false;
665
666
  }
@@ -77,6 +77,6 @@ var getControlHeightCSSValue = exports.getControlHeightCSSValue = function getCo
77
77
  var shouldMaskNodeControls = exports.shouldMaskNodeControls = function shouldMaskNodeControls(nodeType, isTopLevelNode) {
78
78
  return (
79
79
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
80
- isTopLevelNode && ['table'].includes(nodeType) && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_mask') && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
80
+ isTopLevelNode && ['table'].includes(nodeType) && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_mask') && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
81
81
  );
82
82
  };
@@ -608,13 +608,13 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
608
608
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
609
609
  var isSticky = (0, _dragHandlePositions.shouldBeSticky)(nodeType);
610
610
  if (supportsAnchor) {
611
- var bottom = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? (0, _dragHandlePositions.getControlBottomCSSValue)(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
611
+ var bottom = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? (0, _dragHandlePositions.getControlBottomCSSValue)(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
612
612
  return _objectSpread({
613
613
  left: isEdgeCase ? "calc(anchor(".concat(safeAnchorName, " start) + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn ? "calc((anchor(".concat(safeAnchorName, " right) + anchor(").concat(safeAnchorName, " left))/2 - ").concat(_consts.DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(safeAnchorName, " start) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px - ").concat((0, _consts.dragHandleGap)(nodeType, parentNodeType), "px)"),
614
614
  top: (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(safeAnchorName, " top) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(safeAnchorName, " start) + ").concat((0, _consts.topPositionAdjustment)(nodeType), "px)")
615
615
  }, bottom);
616
616
  }
617
- var height = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? (0, _dragHandlePositions.getControlHeightCSSValue)((0, _dragHandlePositions.getNodeHeight)(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, "".concat(_consts.DRAG_HANDLE_HEIGHT), isLayoutColumn) : {};
617
+ var height = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? (0, _dragHandlePositions.getControlHeightCSSValue)((0, _dragHandlePositions.getNodeHeight)(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, "".concat(_consts.DRAG_HANDLE_HEIGHT), isLayoutColumn) : {};
618
618
  return _objectSpread({
619
619
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : (0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
620
620
  top: (0, _dragHandlePositions.getTopPosition)(dom, nodeType)
@@ -756,14 +756,14 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
756
756
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
757
757
  (0, _react2.jsx)("button", {
758
758
  type: "button",
759
- css: [(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? dragHandleButtonStyles : dragHandleButtonStylesOld, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && dragHandleColor,
759
+ css: [(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && dragHandleColor,
760
760
  // ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
761
761
  // See https://product-fabric.atlassian.net/browse/ED-26266
762
762
  _browser.browser.gecko && (0, _platformFeatureFlags.fg)('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && (!(0, _platformFeatureFlags.fg)('platform_editor_no_selection_until_interaction') || hasHadInteraction) && selectedStyles],
763
763
  ref: buttonRef
764
764
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
765
765
  ,
766
- style: !((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls')) && positionStyles || {},
766
+ style: !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && positionStyles || {},
767
767
  onClick: handleOnClick,
768
768
  onMouseDown: handleMouseDown,
769
769
  onKeyDown: handleKeyDown
@@ -843,7 +843,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
843
843
  var isTooltip = !dragHandleDisabled && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_23873');
844
844
  var stickyRender = isTooltip ? stickyWithTooltip() : stickyWithoutTooltip();
845
845
  var render = isTooltip ? buttonWithTooltip() : renderButton();
846
- return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? stickyRender : render;
846
+ return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? stickyRender : render;
847
847
  };
848
848
  var DragHandleWithVisibility = exports.DragHandleWithVisibility = function DragHandleWithVisibility(_ref8) {
849
849
  var view = _ref8.view,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.GlobalStylesWrapper = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
+ var _whitespace = require("@atlaskit/editor-common/whitespace");
10
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
12
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
@@ -157,12 +158,23 @@ var headingWithIndentationInLayoutStyleFix = (0, _react.css)((0, _defineProperty
157
158
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
158
159
  marginTop: '0 !important'
159
160
  }));
160
- var withRelativePosStyle = (0, _react.css)({
161
+ var withRelativePosStyleLegacy = (0, _react.css)({
161
162
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
162
163
  '.ProseMirror': (0, _defineProperty2.default)({}, "&& ".concat(dragHandlerAnchorSelector), {
163
164
  position: 'relative'
164
165
  })
165
166
  });
167
+ var withRelativePosStyle = (0, _react.css)({
168
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
169
+ '.ProseMirror': (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "&& ".concat(dragHandlerAnchorSelector), {
170
+ position: 'relative'
171
+ }), "&& ".concat(dragHandlerAnchorSelector, ":has(> .ProseMirror-trailingBreak:only-child)::before"), {
172
+ // Workaround to force safari to show the cursor on blank lines even when there is no content
173
+ // See: CONFCLOUD-80210
174
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
175
+ content: "\"".concat(_whitespace.ZERO_WIDTH_SPACE, "\"")
176
+ })
177
+ });
166
178
  var withAnchorNameZindexStyle = (0, _react.css)({
167
179
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
168
180
  '.ProseMirror': {
@@ -189,6 +201,6 @@ var blockCardWithoutLayout = (0, _react.css)({
189
201
  });
190
202
  var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
191
203
  return (0, _react.jsx)(_react.Global, {
192
- styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
204
+ styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, (0, _platformFeatureFlags.fg)('platform_editor_fix_safari_cursor_hidden_empty') ? withRelativePosStyle : withRelativePosStyleLegacy, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
193
205
  });
194
206
  };
@@ -37,29 +37,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
37
37
  * @jsx jsx
38
38
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
39
39
  var TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'decisionItem'];
40
- var buttonStyles = (0, _primitives.xcss)({
41
- boxSizing: 'border-box',
42
- display: 'flex',
43
- flexDirection: 'column',
44
- justifyContent: 'center',
45
- alignItems: 'center',
46
- height: "var(--ds-space-300, 24px)",
47
- width: "var(--ds-space-300, 24px)",
48
- border: 'none',
49
- backgroundColor: 'color.background.neutral.subtle',
50
- borderRadius: '50%',
51
- zIndex: 'card',
52
- outline: 'none',
53
- ':hover': {
54
- backgroundColor: 'color.background.neutral.subtle.hovered'
55
- },
56
- ':active': {
57
- backgroundColor: 'color.background.neutral.subtle.pressed'
58
- },
59
- ':focus': {
60
- outline: "2px solid ".concat("var(--ds-border-focused, #388BFF)")
61
- }
62
- });
63
40
  var disabledStyles = (0, _primitives.xcss)({
64
41
  pointerEvents: 'none',
65
42
  ':hover': {
@@ -179,7 +156,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
179
156
  }
180
157
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
181
158
  var isSticky = (0, _dragHandlePositions.shouldBeSticky)(rootNodeType);
182
- var bottom = (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? (0, _dragHandlePositions.getControlBottomCSSValue)(safeAnchorName || anchorName, isSticky, true) : {};
159
+ var bottom = (0, _dragHandlePositions.getControlBottomCSSValue)(safeAnchorName || anchorName, isSticky, true);
183
160
  if (supportsAnchor) {
184
161
  return _objectSpread({
185
162
  left: isEdgeCase ? "calc(anchor(".concat(safeAnchorName, " start) + ").concat((0, _widgetPositions.getLeftPositionForRootElement)(dom, rootNodeType, _consts.QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(anchor(".concat(safeAnchorName, " start) - ").concat(_consts.QUICK_INSERT_DIMENSIONS.width, "px - ").concat((0, _consts.rootElementGap)(rootNodeType), "px + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)"),
@@ -187,11 +164,9 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
187
164
  }, bottom);
188
165
  }
189
166
 
190
- // expensive, calls offsetHeight, guard behind FG
191
- var nodeHeight =
192
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
193
- (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') && (0, _dragHandlePositions.getNodeHeight)(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
194
- var height = (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? (0, _dragHandlePositions.getControlHeightCSSValue)(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)") : {};
167
+ // expensive, calls offsetHeight
168
+ var nodeHeight = (0, _dragHandlePositions.getNodeHeight)(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
169
+ var height = (0, _dragHandlePositions.getControlHeightCSSValue)(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)");
195
170
  return _objectSpread({
196
171
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat((0, _widgetPositions.getLeftPositionForRootElement)(dom, rootNodeType, _consts.QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(".concat((0, _widgetPositions.getLeftPositionForRootElement)(dom, rootNodeType, _consts.QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)"),
197
172
  top: (0, _dragHandlePositions.getTopPosition)(dom, rootNodeType)
@@ -310,7 +285,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
310
285
  testId: "editor-quick-insert-button",
311
286
  type: "button",
312
287
  "aria-label": formatMessage(_messages.blockControlsMessages.insert),
313
- xcss: [(0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? stickyButtonStyles : buttonStyles, isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
288
+ xcss: [stickyButtonStyles, isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
314
289
  onClick: handleQuickInsert,
315
290
  onMouseDown: handleMouseDown,
316
291
  isDisabled: !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') && isTypeAheadOpen
@@ -324,9 +299,9 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
324
299
  , {
325
300
  style: positionStyles,
326
301
  xcss: [containerStaticStyles, isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') && disabledContainerStyles]
327
- }, (0, _platformFeatureFlags.fg)('platform_editor_controls_sticky_controls') ? (0, _react2.jsx)("span", {
302
+ }, (0, _react2.jsx)("span", {
328
303
  css: [tooltipContainerStyles, (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeader, (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeaderWithMarksFix]
329
- }, tooltipPressable()) : tooltipPressable());
304
+ }, tooltipPressable()));
330
305
  };
331
306
  var QuickInsertWithVisibility = exports.QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref5) {
332
307
  var view = _ref5.view,
@@ -21,9 +21,7 @@ export const findHandleDec = (decorations, from, to) => {
21
21
  return decorations.find(from, to, spec => spec.type === TYPE_HANDLE_DEC);
22
22
  };
23
23
  export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) => {
24
- if (!fg('platform_editor_fix_widget_destroy')) {
25
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
26
- }
24
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
27
25
  let unbind;
28
26
  const key = uuid();
29
27
  return Decoration.widget(pos, (view, getPosUnsafe) => {
@@ -114,12 +112,8 @@ export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeTy
114
112
  side: -1,
115
113
  type: TYPE_HANDLE_DEC,
116
114
  testid: `${TYPE_HANDLE_DEC}-${uuid()}`,
117
- destroy: node => {
115
+ destroy: _ => {
118
116
  unbind && unbind();
119
- if (fg('platform_editor_fix_widget_destroy')) {
120
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
121
- ReactDOM.unmountComponentAtNode(node);
122
- }
123
117
  }
124
118
  });
125
119
  };
@@ -667,7 +667,8 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
667
667
  var _api$core2;
668
668
  const isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest(`#${EDIT_AREA_ID}`) !== null;
669
669
 
670
- // don't do anything if the event target is a child of the editor or if the editor has focus
670
+ // don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
671
+ // or if the editor has focus
671
672
  if (isChildOfEditor || view.hasFocus()) {
672
673
  return false;
673
674
  }
@@ -69,6 +69,6 @@ export const getControlHeightCSSValue = (nodeHeight, isSticky, isTopLevelNode, f
69
69
  export const shouldMaskNodeControls = (nodeType, isTopLevelNode) => {
70
70
  return (
71
71
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
72
- isTopLevelNode && ['table'].includes(nodeType) && fg('platform_editor_controls_sticky_controls') && fg('platform_editor_controls_sticky_mask') && editorExperiment('platform_editor_controls', 'variant1')
72
+ isTopLevelNode && ['table'].includes(nodeType) && fg('platform_editor_controls_sticky_mask') && editorExperiment('platform_editor_controls', 'variant1')
73
73
  );
74
74
  };
@@ -597,14 +597,14 @@ export const DragHandle = ({
597
597
  const isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
598
598
  const isSticky = shouldBeSticky(nodeType);
599
599
  if (supportsAnchor) {
600
- const bottom = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
600
+ const bottom = editorExperiment('platform_editor_controls', 'variant1') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
601
601
  return {
602
602
  left: isEdgeCase ? `calc(anchor(${safeAnchorName} start) + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc((anchor(${safeAnchorName} right) + anchor(${safeAnchorName} left))/2 - ${DRAG_HANDLE_HEIGHT / 2}px)` : `calc(anchor(${safeAnchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType, parentNodeType)}px)`,
603
603
  top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc(anchor(${safeAnchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : `calc(anchor(${safeAnchorName} start) + ${topPositionAdjustment(nodeType)}px)`,
604
604
  ...bottom
605
605
  };
606
606
  }
607
- const height = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? getControlHeightCSSValue(getNodeHeight(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, `${DRAG_HANDLE_HEIGHT}`, isLayoutColumn) : {};
607
+ const height = editorExperiment('platform_editor_controls', 'variant1') ? getControlHeightCSSValue(getNodeHeight(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, `${DRAG_HANDLE_HEIGHT}`, isLayoutColumn) : {};
608
608
  return {
609
609
  left: isEdgeCase ? `calc(${(dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0}px + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
610
610
  top: getTopPosition(dom, nodeType),
@@ -743,14 +743,14 @@ export const DragHandle = ({
743
743
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
744
744
  jsx("button", {
745
745
  type: "button",
746
- css: [editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
746
+ css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
747
747
  // ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
748
748
  // See https://product-fabric.atlassian.net/browse/ED-26266
749
749
  browser.gecko && fg('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && (!fg('platform_editor_no_selection_until_interaction') || hasHadInteraction) && selectedStyles],
750
750
  ref: buttonRef
751
751
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
752
752
  ,
753
- style: !(editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls')) && positionStyles || {},
753
+ style: !editorExperiment('platform_editor_controls', 'variant1') && positionStyles || {},
754
754
  onClick: handleOnClick,
755
755
  onMouseDown: handleMouseDown,
756
756
  onKeyDown: handleKeyDown
@@ -822,7 +822,7 @@ export const DragHandle = ({
822
822
  const isTooltip = !dragHandleDisabled && fg('platform_editor_element_drag_and_drop_ed_23873');
823
823
  const stickyRender = isTooltip ? stickyWithTooltip() : stickyWithoutTooltip();
824
824
  const render = isTooltip ? buttonWithTooltip() : renderButton();
825
- return editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? stickyRender : render;
825
+ return editorExperiment('platform_editor_controls', 'variant1') ? stickyRender : render;
826
826
  };
827
827
  export const DragHandleWithVisibility = ({
828
828
  view,
@@ -4,6 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, Global, jsx } from '@emotion/react';
7
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
7
8
  import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
8
9
  import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -184,12 +185,28 @@ const headingWithIndentationInLayoutStyleFix = css({
184
185
  marginTop: '0 !important'
185
186
  }
186
187
  });
188
+ const withRelativePosStyleLegacy = css({
189
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
190
+ '.ProseMirror': {
191
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
192
+ [`&& ${dragHandlerAnchorSelector}`]: {
193
+ position: 'relative'
194
+ }
195
+ }
196
+ });
187
197
  const withRelativePosStyle = css({
188
198
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
189
199
  '.ProseMirror': {
190
200
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
191
201
  [`&& ${dragHandlerAnchorSelector}`]: {
192
202
  position: 'relative'
203
+ },
204
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
205
+ [`&& ${dragHandlerAnchorSelector}:has(> .ProseMirror-trailingBreak:only-child)::before`]: {
206
+ // Workaround to force safari to show the cursor on blank lines even when there is no content
207
+ // See: CONFCLOUD-80210
208
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
209
+ content: `"${ZERO_WIDTH_SPACE}"`
193
210
  }
194
211
  }
195
212
  });
@@ -219,6 +236,6 @@ const blockCardWithoutLayout = css({
219
236
  });
220
237
  export const GlobalStylesWrapper = () => {
221
238
  return jsx(Global, {
222
- styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
239
+ styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, fg('platform_editor_fix_safari_cursor_hidden_empty') ? withRelativePosStyle : withRelativePosStyleLegacy, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
223
240
  });
224
241
  };
@@ -27,29 +27,6 @@ import { isInTextSelection, isNestedNodeSelected, isNonEditableBlock, isSelectio
27
27
  import { createNewLine } from './utils/editor-commands';
28
28
  import { VisibilityContainer } from './visibility-container';
29
29
  const TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'decisionItem'];
30
- const buttonStyles = xcss({
31
- boxSizing: 'border-box',
32
- display: 'flex',
33
- flexDirection: 'column',
34
- justifyContent: 'center',
35
- alignItems: 'center',
36
- height: "var(--ds-space-300, 24px)",
37
- width: "var(--ds-space-300, 24px)",
38
- border: 'none',
39
- backgroundColor: 'color.background.neutral.subtle',
40
- borderRadius: '50%',
41
- zIndex: 'card',
42
- outline: 'none',
43
- ':hover': {
44
- backgroundColor: 'color.background.neutral.subtle.hovered'
45
- },
46
- ':active': {
47
- backgroundColor: 'color.background.neutral.subtle.pressed'
48
- },
49
- ':focus': {
50
- outline: `2px solid ${"var(--ds-border-focused, #388BFF)"}`
51
- }
52
- });
53
30
  const disabledStyles = xcss({
54
31
  pointerEvents: 'none',
55
32
  ':hover': {
@@ -167,7 +144,7 @@ export const TypeAheadControl = ({
167
144
  }
168
145
  const isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
169
146
  const isSticky = shouldBeSticky(rootNodeType);
170
- const bottom = fg('platform_editor_controls_sticky_controls') ? getControlBottomCSSValue(safeAnchorName || anchorName, isSticky, true) : {};
147
+ const bottom = getControlBottomCSSValue(safeAnchorName || anchorName, isSticky, true);
171
148
  if (supportsAnchor) {
172
149
  return {
173
150
  left: isEdgeCase ? `calc(anchor(${safeAnchorName} start) + ${getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates)} + -${QUICK_INSERT_LEFT_OFFSET}px)` : `calc(anchor(${safeAnchorName} start) - ${QUICK_INSERT_DIMENSIONS.width}px - ${rootElementGap(rootNodeType)}px + -${QUICK_INSERT_LEFT_OFFSET}px)`,
@@ -176,11 +153,9 @@ export const TypeAheadControl = ({
176
153
  };
177
154
  }
178
155
 
179
- // expensive, calls offsetHeight, guard behind FG
180
- const nodeHeight =
181
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
182
- fg('platform_editor_controls_sticky_controls') && getNodeHeight(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
183
- const height = fg('platform_editor_controls_sticky_controls') ? getControlHeightCSSValue(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)") : {};
156
+ // expensive, calls offsetHeight
157
+ const nodeHeight = getNodeHeight(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
158
+ const height = getControlHeightCSSValue(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)");
184
159
  return {
185
160
  left: isEdgeCase ? `calc(${(dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0}px + ${getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates)} + -${QUICK_INSERT_LEFT_OFFSET}px)` : `calc(${getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates)} + -${QUICK_INSERT_LEFT_OFFSET}px)`,
186
161
  top: getTopPosition(dom, rootNodeType),
@@ -300,7 +275,7 @@ export const TypeAheadControl = ({
300
275
  testId: "editor-quick-insert-button",
301
276
  type: "button",
302
277
  "aria-label": formatMessage(messages.insert),
303
- xcss: [fg('platform_editor_controls_sticky_controls') ? stickyButtonStyles : buttonStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
278
+ xcss: [stickyButtonStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
304
279
  onClick: handleQuickInsert,
305
280
  onMouseDown: handleMouseDown,
306
281
  isDisabled: !fg('platform_editor_controls_widget_visibility') && isTypeAheadOpen
@@ -313,9 +288,9 @@ export const TypeAheadControl = ({
313
288
  , {
314
289
  style: positionStyles,
315
290
  xcss: [containerStaticStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') && disabledContainerStyles]
316
- }, fg('platform_editor_controls_sticky_controls') ? jsx("span", {
291
+ }, jsx("span", {
317
292
  css: [tooltipContainerStyles, fg('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeader, fg('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeaderWithMarksFix]
318
- }, tooltipPressable()) : tooltipPressable());
293
+ }, tooltipPressable()));
319
294
  };
320
295
  export const QuickInsertWithVisibility = ({
321
296
  view,
@@ -23,9 +23,7 @@ export var findHandleDec = function findHandleDec(decorations, from, to) {
23
23
  });
24
24
  };
25
25
  export var dragHandleDecoration = function dragHandleDecoration(api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) {
26
- if (!fg('platform_editor_fix_widget_destroy')) {
27
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
28
- }
26
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
29
27
  var unbind;
30
28
  var key = uuid();
31
29
  return Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -116,12 +114,8 @@ export var dragHandleDecoration = function dragHandleDecoration(api, formatMessa
116
114
  side: -1,
117
115
  type: TYPE_HANDLE_DEC,
118
116
  testid: "".concat(TYPE_HANDLE_DEC, "-").concat(uuid()),
119
- destroy: function destroy(node) {
117
+ destroy: function destroy(_) {
120
118
  unbind && unbind();
121
- if (fg('platform_editor_fix_widget_destroy')) {
122
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
123
- ReactDOM.unmountComponentAtNode(node);
124
- }
125
119
  }
126
120
  });
127
121
  };
@@ -653,7 +653,8 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
653
653
  var _api$core2;
654
654
  var isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest("#".concat(EDIT_AREA_ID)) !== null;
655
655
 
656
- // don't do anything if the event target is a child of the editor or if the editor has focus
656
+ // don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
657
+ // or if the editor has focus
657
658
  if (isChildOfEditor || view.hasFocus()) {
658
659
  return false;
659
660
  }
@@ -71,6 +71,6 @@ export var getControlHeightCSSValue = function getControlHeightCSSValue(nodeHeig
71
71
  export var shouldMaskNodeControls = function shouldMaskNodeControls(nodeType, isTopLevelNode) {
72
72
  return (
73
73
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
74
- isTopLevelNode && ['table'].includes(nodeType) && fg('platform_editor_controls_sticky_controls') && fg('platform_editor_controls_sticky_mask') && editorExperiment('platform_editor_controls', 'variant1')
74
+ isTopLevelNode && ['table'].includes(nodeType) && fg('platform_editor_controls_sticky_mask') && editorExperiment('platform_editor_controls', 'variant1')
75
75
  );
76
76
  };
@@ -605,13 +605,13 @@ export var DragHandle = function DragHandle(_ref) {
605
605
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
606
606
  var isSticky = shouldBeSticky(nodeType);
607
607
  if (supportsAnchor) {
608
- var bottom = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
608
+ var bottom = editorExperiment('platform_editor_controls', 'variant1') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
609
609
  return _objectSpread({
610
610
  left: isEdgeCase ? "calc(anchor(".concat(safeAnchorName, " start) + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc((anchor(".concat(safeAnchorName, " right) + anchor(").concat(safeAnchorName, " left))/2 - ").concat(DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(safeAnchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType, parentNodeType), "px)"),
611
611
  top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(safeAnchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(safeAnchorName, " start) + ").concat(topPositionAdjustment(nodeType), "px)")
612
612
  }, bottom);
613
613
  }
614
- var height = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? getControlHeightCSSValue(getNodeHeight(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, "".concat(DRAG_HANDLE_HEIGHT), isLayoutColumn) : {};
614
+ var height = editorExperiment('platform_editor_controls', 'variant1') ? getControlHeightCSSValue(getNodeHeight(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, "".concat(DRAG_HANDLE_HEIGHT), isLayoutColumn) : {};
615
615
  return _objectSpread({
616
616
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
617
617
  top: getTopPosition(dom, nodeType)
@@ -753,14 +753,14 @@ export var DragHandle = function DragHandle(_ref) {
753
753
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
754
754
  jsx("button", {
755
755
  type: "button",
756
- css: [editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
756
+ css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
757
757
  // ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
758
758
  // See https://product-fabric.atlassian.net/browse/ED-26266
759
759
  browser.gecko && fg('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && (!fg('platform_editor_no_selection_until_interaction') || hasHadInteraction) && selectedStyles],
760
760
  ref: buttonRef
761
761
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
762
762
  ,
763
- style: !(editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls')) && positionStyles || {},
763
+ style: !editorExperiment('platform_editor_controls', 'variant1') && positionStyles || {},
764
764
  onClick: handleOnClick,
765
765
  onMouseDown: handleMouseDown,
766
766
  onKeyDown: handleKeyDown
@@ -840,7 +840,7 @@ export var DragHandle = function DragHandle(_ref) {
840
840
  var isTooltip = !dragHandleDisabled && fg('platform_editor_element_drag_and_drop_ed_23873');
841
841
  var stickyRender = isTooltip ? stickyWithTooltip() : stickyWithoutTooltip();
842
842
  var render = isTooltip ? buttonWithTooltip() : renderButton();
843
- return editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_sticky_controls') ? stickyRender : render;
843
+ return editorExperiment('platform_editor_controls', 'variant1') ? stickyRender : render;
844
844
  };
845
845
  export var DragHandleWithVisibility = function DragHandleWithVisibility(_ref8) {
846
846
  var view = _ref8.view,
@@ -5,6 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  */
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, Global, jsx } from '@emotion/react';
8
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
8
9
  import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
9
10
  import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -150,12 +151,23 @@ var headingWithIndentationInLayoutStyleFix = css(_defineProperty({}, "".concat(d
150
151
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
151
152
  marginTop: '0 !important'
152
153
  }));
153
- var withRelativePosStyle = css({
154
+ var withRelativePosStyleLegacy = css({
154
155
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
155
156
  '.ProseMirror': _defineProperty({}, "&& ".concat(dragHandlerAnchorSelector), {
156
157
  position: 'relative'
157
158
  })
158
159
  });
160
+ var withRelativePosStyle = css({
161
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
162
+ '.ProseMirror': _defineProperty(_defineProperty({}, "&& ".concat(dragHandlerAnchorSelector), {
163
+ position: 'relative'
164
+ }), "&& ".concat(dragHandlerAnchorSelector, ":has(> .ProseMirror-trailingBreak:only-child)::before"), {
165
+ // Workaround to force safari to show the cursor on blank lines even when there is no content
166
+ // See: CONFCLOUD-80210
167
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
168
+ content: "\"".concat(ZERO_WIDTH_SPACE, "\"")
169
+ })
170
+ });
159
171
  var withAnchorNameZindexStyle = css({
160
172
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
161
173
  '.ProseMirror': {
@@ -182,6 +194,6 @@ var blockCardWithoutLayout = css({
182
194
  });
183
195
  export var GlobalStylesWrapper = function GlobalStylesWrapper() {
184
196
  return jsx(Global, {
185
- styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
197
+ styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_widget_visibility') ? undefined : withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, fg('platform_editor_fix_safari_cursor_hidden_empty') ? withRelativePosStyle : withRelativePosStyleLegacy, topLevelNodeMarginStyles, withAnchorNameZindexStyle,,]
186
198
  });
187
199
  };
@@ -31,29 +31,6 @@ import { isInTextSelection, isNestedNodeSelected, isNonEditableBlock, isSelectio
31
31
  import { createNewLine } from './utils/editor-commands';
32
32
  import { VisibilityContainer } from './visibility-container';
33
33
  var TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'decisionItem'];
34
- var buttonStyles = xcss({
35
- boxSizing: 'border-box',
36
- display: 'flex',
37
- flexDirection: 'column',
38
- justifyContent: 'center',
39
- alignItems: 'center',
40
- height: "var(--ds-space-300, 24px)",
41
- width: "var(--ds-space-300, 24px)",
42
- border: 'none',
43
- backgroundColor: 'color.background.neutral.subtle',
44
- borderRadius: '50%',
45
- zIndex: 'card',
46
- outline: 'none',
47
- ':hover': {
48
- backgroundColor: 'color.background.neutral.subtle.hovered'
49
- },
50
- ':active': {
51
- backgroundColor: 'color.background.neutral.subtle.pressed'
52
- },
53
- ':focus': {
54
- outline: "2px solid ".concat("var(--ds-border-focused, #388BFF)")
55
- }
56
- });
57
34
  var disabledStyles = xcss({
58
35
  pointerEvents: 'none',
59
36
  ':hover': {
@@ -173,7 +150,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
173
150
  }
174
151
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
175
152
  var isSticky = shouldBeSticky(rootNodeType);
176
- var bottom = fg('platform_editor_controls_sticky_controls') ? getControlBottomCSSValue(safeAnchorName || anchorName, isSticky, true) : {};
153
+ var bottom = getControlBottomCSSValue(safeAnchorName || anchorName, isSticky, true);
177
154
  if (supportsAnchor) {
178
155
  return _objectSpread({
179
156
  left: isEdgeCase ? "calc(anchor(".concat(safeAnchorName, " start) + ").concat(getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(anchor(".concat(safeAnchorName, " start) - ").concat(QUICK_INSERT_DIMENSIONS.width, "px - ").concat(rootElementGap(rootNodeType), "px + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)"),
@@ -181,11 +158,9 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
181
158
  }, bottom);
182
159
  }
183
160
 
184
- // expensive, calls offsetHeight, guard behind FG
185
- var nodeHeight =
186
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
187
- fg('platform_editor_controls_sticky_controls') && getNodeHeight(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
188
- var height = fg('platform_editor_controls_sticky_controls') ? getControlHeightCSSValue(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)") : {};
161
+ // expensive, calls offsetHeight
162
+ var nodeHeight = getNodeHeight(dom, safeAnchorName || anchorName, anchorRectCache) || 0;
163
+ var height = getControlHeightCSSValue(nodeHeight, isSticky, true, "var(--ds-space-300, 24px)");
189
164
  return _objectSpread({
190
165
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat(getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(".concat(getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)"),
191
166
  top: getTopPosition(dom, rootNodeType)
@@ -304,7 +279,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
304
279
  testId: "editor-quick-insert-button",
305
280
  type: "button",
306
281
  "aria-label": formatMessage(messages.insert),
307
- xcss: [fg('platform_editor_controls_sticky_controls') ? stickyButtonStyles : buttonStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
282
+ xcss: [stickyButtonStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? disabledStyles : undefined],
308
283
  onClick: handleQuickInsert,
309
284
  onMouseDown: handleMouseDown,
310
285
  isDisabled: !fg('platform_editor_controls_widget_visibility') && isTypeAheadOpen
@@ -318,9 +293,9 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
318
293
  , {
319
294
  style: positionStyles,
320
295
  xcss: [containerStaticStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') && disabledContainerStyles]
321
- }, fg('platform_editor_controls_sticky_controls') ? jsx("span", {
296
+ }, jsx("span", {
322
297
  css: [tooltipContainerStyles, fg('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeader, fg('platform_editor_controls_patch_4') && tooltipContainerStylesStickyHeaderWithMarksFix]
323
- }, tooltipPressable()) : tooltipPressable());
298
+ }, tooltipPressable()));
324
299
  };
325
300
  export var QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref5) {
326
301
  var view = _ref5.view,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "3.13.3",
3
+ "version": "3.13.5",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^104.0.0",
36
+ "@atlaskit/editor-common": "^104.1.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
@@ -48,14 +48,14 @@
48
48
  "@atlaskit/editor-prosemirror": "7.0.0",
49
49
  "@atlaskit/editor-shared-styles": "^3.4.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
- "@atlaskit/icon": "^25.6.0",
51
+ "@atlaskit/icon": "^25.7.0",
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
56
56
  "@atlaskit/primitives": "^14.7.0",
57
57
  "@atlaskit/theme": "^18.0.0",
58
- "@atlaskit/tmp-editor-statsig": "^4.16.0",
58
+ "@atlaskit/tmp-editor-statsig": "^4.17.0",
59
59
  "@atlaskit/tokens": "^4.8.0",
60
60
  "@atlaskit/tooltip": "^20.0.0",
61
61
  "@babel/runtime": "^7.0.0",
@@ -157,7 +157,7 @@
157
157
  "platform_editor_elements_dnd_multi_select_patch_3": {
158
158
  "type": "boolean"
159
159
  },
160
- "platform_editor_controls_sticky_controls": {
160
+ "platform_editor_fix_safari_cursor_hidden_empty": {
161
161
  "type": "boolean"
162
162
  },
163
163
  "platform_editor_controls_patch_2": {