@atlaskit/editor-plugin-block-controls 3.3.14 → 3.3.16

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,23 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 3.3.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#127305](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127305)
8
+ [`d73df5795b977`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d73df5795b977) -
9
+ Fix range error
10
+
11
+ ## 3.3.15
12
+
13
+ ### Patch Changes
14
+
15
+ - [#127338](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127338)
16
+ [`2492ca26f15ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2492ca26f15ad) -
17
+ Change position of quick insert tooltip to ‘top’, changed icon color of quick insert to icon,
18
+ matches drag handle
19
+ - Updated dependencies
20
+
3
21
  ## 3.3.14
4
22
 
5
23
  ### Patch Changes
@@ -275,9 +275,15 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
275
275
  }
276
276
  }
277
277
  var nodeType = (_state$doc$nodeAt = state.doc.nodeAt(currentNodePos)) === null || _state$doc$nodeAt === void 0 ? void 0 : _state$doc$nodeAt.type.name;
278
-
279
- // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
280
- var shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_accessibility');
278
+ var shouldMoveNode = false;
279
+ if (moveToPos > -1 && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_2')) {
280
+ var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
281
+ var isSourceLayoutColumn = nodeType === 'layoutColumn';
282
+ shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_accessibility');
283
+ } else {
284
+ // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
285
+ shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_accessibility');
286
+ }
281
287
  var _expandSelectionBound = (0, _selection.expandSelectionBounds)($currentNodePos, selection.$to),
282
288
  $newAnchor = _expandSelectionBound.$anchor,
283
289
  $newHead = _expandSelectionBound.$head;
@@ -340,7 +346,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
340
346
  return function (_ref7) {
341
347
  var _api$blockControls$co;
342
348
  var tr = _ref7.tr;
343
- if (!api) {
349
+ if (!api || (start < 0 || to < 0) && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_2')) {
344
350
  return tr;
345
351
  }
346
352
  var handleNode = tr.doc.nodeAt(start);
@@ -34,7 +34,6 @@ var buttonStyles = (0, _primitives.xcss)({
34
34
  border: 'none',
35
35
  backgroundColor: 'color.background.neutral.subtle',
36
36
  borderRadius: '50%',
37
- color: 'color.text.accent.gray',
38
37
  zIndex: 'card',
39
38
  outline: 'none',
40
39
  ':hover': {
@@ -163,7 +162,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
163
162
  }
164
163
  }
165
164
  }
166
- api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || _api$quickInsert.actions.openTypeAhead('blockControl');
165
+ (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || _api$quickInsert.actions.openTypeAhead('blockControl');
167
166
  }, [api, getPos, view]);
168
167
  return (
169
168
  /*#__PURE__*/
@@ -172,6 +171,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
172
171
  style: positionStyles,
173
172
  xcss: [containerStaticStyles]
174
173
  }, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
174
+ position: "top",
175
175
  content: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
176
176
  description: formatMessage(_messages.blockControlsMessages.insert)
177
177
  })
@@ -181,7 +181,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
181
181
  xcss: [buttonStyles],
182
182
  onClick: handleQuickInsert
183
183
  }, /*#__PURE__*/_react.default.createElement(_add.default, {
184
- label: "add"
184
+ label: "add",
185
+ color: "var(--ds-icon, #44546F)"
185
186
  }))))
186
187
  );
187
188
  };
@@ -275,9 +275,15 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
275
275
  }
276
276
  }
277
277
  const nodeType = (_state$doc$nodeAt = state.doc.nodeAt(currentNodePos)) === null || _state$doc$nodeAt === void 0 ? void 0 : _state$doc$nodeAt.type.name;
278
-
279
- // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
280
- const shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && fg('platform_editor_advanced_layouts_accessibility');
278
+ let shouldMoveNode = false;
279
+ if (moveToPos > -1 && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
280
+ const isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
281
+ const isSourceLayoutColumn = nodeType === 'layoutColumn';
282
+ shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn && fg('platform_editor_advanced_layouts_accessibility');
283
+ } else {
284
+ // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
285
+ shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && fg('platform_editor_advanced_layouts_accessibility');
286
+ }
281
287
  const {
282
288
  $anchor: $newAnchor,
283
289
  $head: $newHead
@@ -341,7 +347,7 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
341
347
  tr
342
348
  }) => {
343
349
  var _api$blockControls$co2;
344
- if (!api) {
350
+ if (!api || (start < 0 || to < 0) && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
345
351
  return tr;
346
352
  }
347
353
  const handleNode = tr.doc.nodeAt(start);
@@ -23,7 +23,6 @@ const buttonStyles = xcss({
23
23
  border: 'none',
24
24
  backgroundColor: 'color.background.neutral.subtle',
25
25
  borderRadius: '50%',
26
- color: 'color.text.accent.gray',
27
26
  zIndex: 'card',
28
27
  outline: 'none',
29
28
  ':hover': {
@@ -151,7 +150,7 @@ export const TypeAheadControl = ({
151
150
  }
152
151
  }
153
152
  }
154
- api === null || api === void 0 ? void 0 : (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.actions.openTypeAhead('blockControl');
153
+ (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.actions.openTypeAhead('blockControl');
155
154
  }, [api, getPos, view]);
156
155
  return (
157
156
  /*#__PURE__*/
@@ -160,6 +159,7 @@ export const TypeAheadControl = ({
160
159
  style: positionStyles,
161
160
  xcss: [containerStaticStyles]
162
161
  }, /*#__PURE__*/React.createElement(Tooltip, {
162
+ position: "top",
163
163
  content: /*#__PURE__*/React.createElement(ToolTipContent, {
164
164
  description: formatMessage(messages.insert)
165
165
  })
@@ -169,7 +169,8 @@ export const TypeAheadControl = ({
169
169
  xcss: [buttonStyles],
170
170
  onClick: handleQuickInsert
171
171
  }, /*#__PURE__*/React.createElement(AddIcon, {
172
- label: "add"
172
+ label: "add",
173
+ color: "var(--ds-icon, #44546F)"
173
174
  }))))
174
175
  );
175
176
  };
@@ -269,9 +269,15 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
269
269
  }
270
270
  }
271
271
  var nodeType = (_state$doc$nodeAt = state.doc.nodeAt(currentNodePos)) === null || _state$doc$nodeAt === void 0 ? void 0 : _state$doc$nodeAt.type.name;
272
-
273
- // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
274
- var shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && fg('platform_editor_advanced_layouts_accessibility');
272
+ var shouldMoveNode = false;
273
+ if (moveToPos > -1 && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
274
+ var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
275
+ var isSourceLayoutColumn = nodeType === 'layoutColumn';
276
+ shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn && fg('platform_editor_advanced_layouts_accessibility');
277
+ } else {
278
+ // only move the node if the destination is at the same depth, not support moving a nested node to a parent node
279
+ shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn' && fg('platform_editor_advanced_layouts_accessibility');
280
+ }
275
281
  var _expandSelectionBound = expandSelectionBounds($currentNodePos, selection.$to),
276
282
  $newAnchor = _expandSelectionBound.$anchor,
277
283
  $newHead = _expandSelectionBound.$head;
@@ -334,7 +340,7 @@ export var moveNode = function moveNode(api) {
334
340
  return function (_ref7) {
335
341
  var _api$blockControls$co;
336
342
  var tr = _ref7.tr;
337
- if (!api) {
343
+ if (!api || (start < 0 || to < 0) && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
338
344
  return tr;
339
345
  }
340
346
  var handleNode = tr.doc.nodeAt(start);
@@ -24,7 +24,6 @@ var buttonStyles = xcss({
24
24
  border: 'none',
25
25
  backgroundColor: 'color.background.neutral.subtle',
26
26
  borderRadius: '50%',
27
- color: 'color.text.accent.gray',
28
27
  zIndex: 'card',
29
28
  outline: 'none',
30
29
  ':hover': {
@@ -153,7 +152,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
153
152
  }
154
153
  }
155
154
  }
156
- api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || _api$quickInsert.actions.openTypeAhead('blockControl');
155
+ (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || _api$quickInsert.actions.openTypeAhead('blockControl');
157
156
  }, [api, getPos, view]);
158
157
  return (
159
158
  /*#__PURE__*/
@@ -162,6 +161,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
162
161
  style: positionStyles,
163
162
  xcss: [containerStaticStyles]
164
163
  }, /*#__PURE__*/React.createElement(Tooltip, {
164
+ position: "top",
165
165
  content: /*#__PURE__*/React.createElement(ToolTipContent, {
166
166
  description: formatMessage(messages.insert)
167
167
  })
@@ -171,7 +171,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
171
171
  xcss: [buttonStyles],
172
172
  onClick: handleQuickInsert
173
173
  }, /*#__PURE__*/React.createElement(AddIcon, {
174
- label: "add"
174
+ label: "add",
175
+ color: "var(--ds-icon, #44546F)"
175
176
  }))))
176
177
  );
177
178
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "3.3.14",
3
+ "version": "3.3.16",
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": "^102.8.0",
36
+ "@atlaskit/editor-common": "^102.10.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",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
53
53
  "@atlaskit/primitives": "^14.1.0",
54
54
  "@atlaskit/theme": "^18.0.0",
55
- "@atlaskit/tmp-editor-statsig": "^4.0.0",
55
+ "@atlaskit/tmp-editor-statsig": "^4.1.0",
56
56
  "@atlaskit/tokens": "^4.5.0",
57
57
  "@atlaskit/tooltip": "^20.0.0",
58
58
  "@babel/runtime": "^7.0.0",
@@ -169,6 +169,9 @@
169
169
  },
170
170
  "platform_editor_drag_layout_column_into_nodes": {
171
171
  "type": "boolean"
172
+ },
173
+ "platform_editor_elements_dnd_multi_select_patch_2": {
174
+ "type": "boolean"
172
175
  }
173
176
  }
174
177
  }