@atlaskit/editor-plugin-block-controls 3.10.2 → 3.11.0

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
+ ## 3.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#141095](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141095)
8
+ [`5f0694bcf5c1f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f0694bcf5c1f) -
9
+ Add UserIntentPlugin as an optional dependency, and add its corresponding package as package
10
+ dependency
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 3.10.3
17
+
18
+ ### Patch Changes
19
+
20
+ - [#139698](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139698)
21
+ [`cf8ea53ed0264`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf8ea53ed0264) -
22
+ Clean-up nested expand feature gate
23
+ - [#142866](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142866)
24
+ [`b2ff4351e7e00`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2ff4351e7e00) -
25
+ Fix missing destroy callback for quick insert
26
+ - Updated dependencies
27
+
3
28
  ## 3.10.2
4
29
 
5
30
  ### Patch Changes
@@ -114,6 +114,12 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
114
114
  tr: tr
115
115
  });
116
116
  }
117
+ if ((0, _platformFeatureFlags.fg)('platform_editor_user_intent_plugin')) {
118
+ var _api$userIntent;
119
+ api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('dragging')({
120
+ tr: tr
121
+ });
122
+ }
117
123
  return tr;
118
124
  };
119
125
  },
@@ -30,7 +30,9 @@ 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
- (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
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
+ }
34
36
  var unbind;
35
37
  var key = (0, _uuid.default)();
36
38
  return _view.Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -121,8 +123,12 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
121
123
  side: -1,
122
124
  type: _decorationsCommon.TYPE_HANDLE_DEC,
123
125
  testid: "".concat(_decorationsCommon.TYPE_HANDLE_DEC, "-").concat((0, _uuid.default)()),
124
- destroy: function destroy() {
125
- return unbind && unbind();
126
+ destroy: function destroy(node) {
127
+ 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
+ }
126
132
  }
127
133
  });
128
134
  };
@@ -57,6 +57,11 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
57
57
  return element;
58
58
  }, {
59
59
  side: -2,
60
- type: TYPE_QUICK_INSERT
60
+ type: TYPE_QUICK_INSERT,
61
+ destroy: function destroy(_) {
62
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
63
+ nodeViewPortalProviderAPI.remove(key);
64
+ }
65
+ }
61
66
  });
62
67
  };
@@ -83,12 +83,15 @@ var destroyFn = function destroyFn(api, editorView) {
83
83
  if (isHTMLElement(scrollable)) {
84
84
  scrollable.style.setProperty('scroll-behavior', null);
85
85
  }
86
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
86
+ if (!api) {
87
+ return;
88
+ }
89
+ (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
87
90
  var tr = _ref3.tr;
88
91
  var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
89
92
  if (isMultiSelect) {
90
93
  var _api$blockControls, _api$selection;
91
- var _ref4 = (api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
94
+ var _ref4 = ((_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
92
95
  multiSelectDnD = _ref4.multiSelectDnD;
93
96
  // Restore the users initial Editor selection when the drop completes
94
97
  if (multiSelectDnD) {
@@ -105,7 +108,7 @@ var destroyFn = function destroyFn(api, editorView) {
105
108
  }
106
109
  }
107
110
  }
108
- api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || _api$selection.commands.clearManualSelection()({
111
+ (_api$selection = api.selection) === null || _api$selection === void 0 || _api$selection.commands.clearManualSelection()({
109
112
  tr: tr
110
113
  });
111
114
  }
@@ -116,7 +119,7 @@ var destroyFn = function destroyFn(api, editorView) {
116
119
  if (lastDragCancelled) {
117
120
  var _api$analytics2;
118
121
  var nodeTypes, hasSelectedMultipleNodes;
119
- if (isMultiSelect && api) {
122
+ if (isMultiSelect) {
120
123
  var position = (0, _selection2.getSelectedSlicePosition)(start, tr, api);
121
124
  var attributes = (0, _analytics2.getMultiSelectAnalyticsAttributes)(tr, position.from, position.to);
122
125
  nodeTypes = attributes.nodeTypes;
@@ -124,7 +127,7 @@ var destroyFn = function destroyFn(api, editorView) {
124
127
  }
125
128
  var resolvedMovingNode = tr.doc.resolve(start);
126
129
  var maybeNode = resolvedMovingNode.nodeAfter;
127
- api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
130
+ (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
128
131
  eventType: _analytics.EVENT_TYPE.UI,
129
132
  action: _analytics.ACTION.CANCELLED,
130
133
  actionSubject: _analytics.ACTION_SUBJECT.DRAG,
@@ -140,7 +143,13 @@ var destroyFn = function destroyFn(api, editorView) {
140
143
  }
141
144
  if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
142
145
  var _api$metrics;
143
- api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
146
+ (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
147
+ tr: tr
148
+ });
149
+ }
150
+ if ((0, _platformFeatureFlags.fg)('platform_editor_user_intent_plugin')) {
151
+ var _api$userIntent;
152
+ (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('default')({
144
153
  tr: tr
145
154
  });
146
155
  }
@@ -144,13 +144,6 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
144
144
  }
145
145
  }
146
146
 
147
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
148
- if ((0, _experiments.editorExperiment)('nested-expand-in-expand', false)) {
149
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
150
- return false;
151
- }
152
- }
153
-
154
147
  // NOTE: this will block drop targets from showing for dragging a table into another table
155
148
  // unless nested tables are supported and the nesting depth does not exceed 1
156
149
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -166,6 +166,7 @@ var tooltipContainerStyles = (0, _react2.css)({
166
166
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
167
167
  bottom: "-".concat(_consts.STICKY_CONTROLS_TOP_MARGIN, "px"),
168
168
  position: 'sticky',
169
+ display: 'block',
169
170
  zIndex: 100 // card = 100
170
171
  });
171
172
  var tooltipContainerStylesStickyHeaderWithMask = (0, _react2.css)({
@@ -105,6 +105,7 @@ var tooltipContainerStyles = (0, _react2.css)({
105
105
  top: '8px',
106
106
  bottom: '-8px',
107
107
  position: 'sticky',
108
+ display: 'block',
108
109
  zIndex: 'card'
109
110
  });
110
111
  var tooltipContainerStylesStickyHeader = (0, _react2.css)({
@@ -105,6 +105,12 @@ export const blockControlsPlugin = ({
105
105
  tr
106
106
  });
107
107
  }
108
+ if (fg('platform_editor_user_intent_plugin')) {
109
+ var _api$userIntent;
110
+ api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('dragging')({
111
+ tr
112
+ });
113
+ }
108
114
  return tr;
109
115
  },
110
116
  setMultiSelectPositions: (anchor, head) => ({
@@ -21,7 +21,9 @@ 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
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
24
+ if (!fg('platform_editor_fix_widget_destroy')) {
25
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
26
+ }
25
27
  let unbind;
26
28
  const key = uuid();
27
29
  return Decoration.widget(pos, (view, getPosUnsafe) => {
@@ -112,6 +114,12 @@ export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeTy
112
114
  side: -1,
113
115
  type: TYPE_HANDLE_DEC,
114
116
  testid: `${TYPE_HANDLE_DEC}-${uuid()}`,
115
- destroy: () => unbind && unbind()
117
+ destroy: node => {
118
+ 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
+ }
116
124
  });
117
125
  };
@@ -44,6 +44,11 @@ export const quickInsertButtonDecoration = (api, formatMessage, rootPos, anchorN
44
44
  return element;
45
45
  }, {
46
46
  side: -2,
47
- type: TYPE_QUICK_INSERT
47
+ type: TYPE_QUICK_INSERT,
48
+ destroy: _ => {
49
+ if (fg('platform_editor_fix_widget_destroy')) {
50
+ nodeViewPortalProviderAPI.remove(key);
51
+ }
52
+ }
48
53
  });
49
54
  };
@@ -75,7 +75,10 @@ const destroyFn = (api, editorView) => {
75
75
  if (isHTMLElement(scrollable)) {
76
76
  scrollable.style.setProperty('scroll-behavior', null);
77
77
  }
78
- api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(({
78
+ if (!api) {
79
+ return;
80
+ }
81
+ (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(({
79
82
  tr
80
83
  }) => {
81
84
  const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
@@ -83,7 +86,7 @@ const destroyFn = (api, editorView) => {
83
86
  var _api$blockControls, _api$selection;
84
87
  const {
85
88
  multiSelectDnD
86
- } = (api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {};
89
+ } = ((_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {};
87
90
  // Restore the users initial Editor selection when the drop completes
88
91
  if (multiSelectDnD) {
89
92
  // If the TextSelection between the drag start and end has changed, the document has changed, and we should not reapply the last selection
@@ -99,7 +102,7 @@ const destroyFn = (api, editorView) => {
99
102
  }
100
103
  }
101
104
  }
102
- api === null || api === void 0 ? void 0 : (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.commands.clearManualSelection()({
105
+ (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.commands.clearManualSelection()({
103
106
  tr
104
107
  });
105
108
  }
@@ -111,7 +114,7 @@ const destroyFn = (api, editorView) => {
111
114
  if (lastDragCancelled) {
112
115
  var _api$analytics2;
113
116
  let nodeTypes, hasSelectedMultipleNodes;
114
- if (isMultiSelect && api) {
117
+ if (isMultiSelect) {
115
118
  const position = getSelectedSlicePosition(start, tr, api);
116
119
  const attributes = getMultiSelectAnalyticsAttributes(tr, position.from, position.to);
117
120
  nodeTypes = attributes.nodeTypes;
@@ -119,7 +122,7 @@ const destroyFn = (api, editorView) => {
119
122
  }
120
123
  const resolvedMovingNode = tr.doc.resolve(start);
121
124
  const maybeNode = resolvedMovingNode.nodeAfter;
122
- api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
125
+ (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
123
126
  eventType: EVENT_TYPE.UI,
124
127
  action: ACTION.CANCELLED,
125
128
  actionSubject: ACTION_SUBJECT.DRAG,
@@ -136,7 +139,13 @@ const destroyFn = (api, editorView) => {
136
139
  }
137
140
  if (fg('platform_editor_ease_of_use_metrics')) {
138
141
  var _api$metrics;
139
- api === null || api === void 0 ? void 0 : (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.startActiveSessionTimer()({
142
+ (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.startActiveSessionTimer()({
143
+ tr
144
+ });
145
+ }
146
+ if (fg('platform_editor_user_intent_plugin')) {
147
+ var _api$userIntent;
148
+ (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('default')({
140
149
  tr
141
150
  });
142
151
  }
@@ -135,13 +135,6 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
135
135
  }
136
136
  }
137
137
 
138
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
139
- if (editorExperiment('nested-expand-in-expand', false)) {
140
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
141
- return false;
142
- }
143
- }
144
-
145
138
  // NOTE: this will block drop targets from showing for dragging a table into another table
146
139
  // unless nested tables are supported and the nesting depth does not exceed 1
147
140
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -158,6 +158,7 @@ const tooltipContainerStyles = css({
158
158
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
159
159
  bottom: `-${STICKY_CONTROLS_TOP_MARGIN}px`,
160
160
  position: 'sticky',
161
+ display: 'block',
161
162
  zIndex: 100 // card = 100
162
163
  });
163
164
  const tooltipContainerStylesStickyHeaderWithMask = css({
@@ -95,6 +95,7 @@ const tooltipContainerStyles = css({
95
95
  top: '8px',
96
96
  bottom: '-8px',
97
97
  position: 'sticky',
98
+ display: 'block',
98
99
  zIndex: 'card'
99
100
  });
100
101
  const tooltipContainerStylesStickyHeader = css({
@@ -107,6 +107,12 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
107
107
  tr: tr
108
108
  });
109
109
  }
110
+ if (fg('platform_editor_user_intent_plugin')) {
111
+ var _api$userIntent;
112
+ api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('dragging')({
113
+ tr: tr
114
+ });
115
+ }
110
116
  return tr;
111
117
  };
112
118
  },
@@ -23,7 +23,9 @@ 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
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
26
+ if (!fg('platform_editor_fix_widget_destroy')) {
27
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
28
+ }
27
29
  var unbind;
28
30
  var key = uuid();
29
31
  return Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -114,8 +116,12 @@ export var dragHandleDecoration = function dragHandleDecoration(api, formatMessa
114
116
  side: -1,
115
117
  type: TYPE_HANDLE_DEC,
116
118
  testid: "".concat(TYPE_HANDLE_DEC, "-").concat(uuid()),
117
- destroy: function destroy() {
118
- return unbind && unbind();
119
+ destroy: function destroy(node) {
120
+ 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
+ }
119
125
  }
120
126
  });
121
127
  };
@@ -50,6 +50,11 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(ap
50
50
  return element;
51
51
  }, {
52
52
  side: -2,
53
- type: TYPE_QUICK_INSERT
53
+ type: TYPE_QUICK_INSERT,
54
+ destroy: function destroy(_) {
55
+ if (fg('platform_editor_fix_widget_destroy')) {
56
+ nodeViewPortalProviderAPI.remove(key);
57
+ }
58
+ }
54
59
  });
55
60
  };
@@ -76,12 +76,15 @@ var destroyFn = function destroyFn(api, editorView) {
76
76
  if (isHTMLElement(scrollable)) {
77
77
  scrollable.style.setProperty('scroll-behavior', null);
78
78
  }
79
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
79
+ if (!api) {
80
+ return;
81
+ }
82
+ (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
80
83
  var tr = _ref3.tr;
81
84
  var isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
82
85
  if (isMultiSelect) {
83
86
  var _api$blockControls, _api$selection;
84
- var _ref4 = (api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
87
+ var _ref4 = ((_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
85
88
  multiSelectDnD = _ref4.multiSelectDnD;
86
89
  // Restore the users initial Editor selection when the drop completes
87
90
  if (multiSelectDnD) {
@@ -98,7 +101,7 @@ var destroyFn = function destroyFn(api, editorView) {
98
101
  }
99
102
  }
100
103
  }
101
- api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || _api$selection.commands.clearManualSelection()({
104
+ (_api$selection = api.selection) === null || _api$selection === void 0 || _api$selection.commands.clearManualSelection()({
102
105
  tr: tr
103
106
  });
104
107
  }
@@ -109,7 +112,7 @@ var destroyFn = function destroyFn(api, editorView) {
109
112
  if (lastDragCancelled) {
110
113
  var _api$analytics2;
111
114
  var nodeTypes, hasSelectedMultipleNodes;
112
- if (isMultiSelect && api) {
115
+ if (isMultiSelect) {
113
116
  var position = getSelectedSlicePosition(start, tr, api);
114
117
  var attributes = getMultiSelectAnalyticsAttributes(tr, position.from, position.to);
115
118
  nodeTypes = attributes.nodeTypes;
@@ -117,7 +120,7 @@ var destroyFn = function destroyFn(api, editorView) {
117
120
  }
118
121
  var resolvedMovingNode = tr.doc.resolve(start);
119
122
  var maybeNode = resolvedMovingNode.nodeAfter;
120
- api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
123
+ (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
121
124
  eventType: EVENT_TYPE.UI,
122
125
  action: ACTION.CANCELLED,
123
126
  actionSubject: ACTION_SUBJECT.DRAG,
@@ -133,7 +136,13 @@ var destroyFn = function destroyFn(api, editorView) {
133
136
  }
134
137
  if (fg('platform_editor_ease_of_use_metrics')) {
135
138
  var _api$metrics;
136
- api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
139
+ (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
140
+ tr: tr
141
+ });
142
+ }
143
+ if (fg('platform_editor_user_intent_plugin')) {
144
+ var _api$userIntent;
145
+ (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('default')({
137
146
  tr: tr
138
147
  });
139
148
  }
@@ -134,13 +134,6 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
134
134
  }
135
135
  }
136
136
 
137
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
138
- if (editorExperiment('nested-expand-in-expand', false)) {
139
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
140
- return false;
141
- }
142
- }
143
-
144
137
  // NOTE: this will block drop targets from showing for dragging a table into another table
145
138
  // unless nested tables are supported and the nesting depth does not exceed 1
146
139
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -163,6 +163,7 @@ var tooltipContainerStyles = css({
163
163
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
164
164
  bottom: "-".concat(STICKY_CONTROLS_TOP_MARGIN, "px"),
165
165
  position: 'sticky',
166
+ display: 'block',
166
167
  zIndex: 100 // card = 100
167
168
  });
168
169
  var tooltipContainerStylesStickyHeaderWithMask = css({
@@ -99,6 +99,7 @@ var tooltipContainerStyles = css({
99
99
  top: '8px',
100
100
  bottom: '-8px',
101
101
  position: 'sticky',
102
+ display: 'block',
102
103
  zIndex: 'card'
103
104
  });
104
105
  var tooltipContainerStylesStickyHeader = css({
@@ -9,6 +9,7 @@ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
9
9
  import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
10
10
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
11
11
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
12
+ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
12
13
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
13
14
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
14
15
  export type ActiveNode = {
@@ -77,7 +78,8 @@ export type BlockControlsPluginDependencies = [
77
78
  OptionalPlugin<QuickInsertPlugin>,
78
79
  OptionalPlugin<TypeAheadPlugin>,
79
80
  OptionalPlugin<SelectionPlugin>,
80
- OptionalPlugin<MetricsPlugin>
81
+ OptionalPlugin<MetricsPlugin>,
82
+ OptionalPlugin<UserIntentPlugin>
81
83
  ];
82
84
  export type BlockControlsPlugin = NextEditorPlugin<'blockControls', {
83
85
  dependencies: BlockControlsPluginDependencies;
@@ -9,6 +9,7 @@ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
9
9
  import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
10
10
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
11
11
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
12
+ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
12
13
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
13
14
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
14
15
  export type ActiveNode = {
@@ -77,7 +78,8 @@ export type BlockControlsPluginDependencies = [
77
78
  OptionalPlugin<QuickInsertPlugin>,
78
79
  OptionalPlugin<TypeAheadPlugin>,
79
80
  OptionalPlugin<SelectionPlugin>,
80
- OptionalPlugin<MetricsPlugin>
81
+ OptionalPlugin<MetricsPlugin>,
82
+ OptionalPlugin<UserIntentPlugin>
81
83
  ];
82
84
  export type BlockControlsPlugin = NextEditorPlugin<'blockControls', {
83
85
  dependencies: BlockControlsPluginDependencies;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "3.10.2",
3
+ "version": "3.11.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,15 +33,16 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^103.8.0",
36
+ "@atlaskit/editor-common": "^103.11.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",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.4.0",
41
41
  "@atlaskit/editor-plugin-metrics": "^3.4.0",
42
- "@atlaskit/editor-plugin-quick-insert": "^2.3.0",
42
+ "@atlaskit/editor-plugin-quick-insert": "^2.4.0",
43
43
  "@atlaskit/editor-plugin-selection": "^2.1.0",
44
- "@atlaskit/editor-plugin-type-ahead": "^2.4.0",
44
+ "@atlaskit/editor-plugin-type-ahead": "^2.5.0",
45
+ "@atlaskit/editor-plugin-user-intent": "^0.1.0",
45
46
  "@atlaskit/editor-plugin-width": "^3.0.0",
46
47
  "@atlaskit/editor-prosemirror": "7.0.0",
47
48
  "@atlaskit/editor-shared-styles": "^3.4.0",
@@ -53,7 +54,7 @@
53
54
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
54
55
  "@atlaskit/primitives": "^14.4.0",
55
56
  "@atlaskit/theme": "^18.0.0",
56
- "@atlaskit/tmp-editor-statsig": "^4.10.0",
57
+ "@atlaskit/tmp-editor-statsig": "^4.12.0",
57
58
  "@atlaskit/tokens": "^4.8.0",
58
59
  "@atlaskit/tooltip": "^20.0.0",
59
60
  "@babel/runtime": "^7.0.0",
@@ -176,8 +177,14 @@
176
177
  "platform_editor_controls_patch_5": {
177
178
  "type": "boolean"
178
179
  },
180
+ "platform_editor_user_intent_plugin": {
181
+ "type": "boolean"
182
+ },
179
183
  "platform_editor_controls_sticky_mask": {
180
184
  "type": "boolean"
185
+ },
186
+ "platform_editor_fix_widget_destroy": {
187
+ "type": "boolean"
181
188
  }
182
189
  }
183
190
  }