@atlaskit/editor-plugin-block-controls 3.3.5 → 3.3.6

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,14 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 3.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#121718](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121718)
8
+ [`ea6771bd5b498`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea6771bd5b498) -
9
+ [ux] ED-26814 fix copy and paste non bodied macro in list item
10
+ - Updated dependencies
11
+
3
12
  ## 3.3.5
4
13
 
5
14
  ### Patch Changes
@@ -379,7 +379,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
379
379
  var destParent = $to.node($to.depth);
380
380
  var sourceNode = $handlePos.nodeAfter;
381
381
 
382
- //TODO: Does this need to be updated with new selection logic above? ^
382
+ //TODO: ED-26959 - Does this need to be updated with new selection logic above? ^
383
383
  // Move a layout column to top level
384
384
  if (sourceNode && isDragLayoutColumnToTopLevel($handlePos, $to)) {
385
385
  // need update after we support single column layout.
@@ -207,7 +207,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
207
207
  sourceTo = Math.max(anchor, head);
208
208
  sourceContent = tr.doc.slice(sourceFrom, sourceTo).content;
209
209
 
210
- // TODO: this might become expensive for large content, consider removing it if check has been done beforehand
210
+ // TODO: ED-26959 - this might become expensive for large content, consider removing it if check has been done beforehand
211
211
  if ((0, _checkFragment.containsNodeOfType)(sourceContent, 'layoutSection')) {
212
212
  return;
213
213
  }
@@ -286,7 +286,7 @@ var getBreakoutMode = function getBreakoutMode(content, breakout) {
286
286
  }
287
287
  };
288
288
 
289
- // TODO: As part of platform_editor_element_drag_and_drop_multiselect clean up,
289
+ // TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
290
290
  // source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
291
291
  var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
292
292
  return function (from, to, options) {
@@ -67,7 +67,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
67
67
  }
68
68
 
69
69
  // We want to exlude handles from showing for wrapped nodes
70
- // TODO We should be able remove these check if we decided to
70
+ // TODO: ED-26959 - We should be able remove these check if we decided to
71
71
  // go we not decoration for wrapped image solution.
72
72
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '')) {
73
73
  return false;
@@ -633,7 +633,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
633
633
  return false;
634
634
  }
635
635
 
636
- // TODO: Review usage of posAtDOM here
636
+ // TODO: ED-26959 - Review usage of posAtDOM here
637
637
  var domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
638
638
  var nodeTarget = state.doc.nodeAt(domPos);
639
639
  var isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
@@ -59,7 +59,7 @@ var ActiveAnchorTracker = exports.ActiveAnchorTracker = /*#__PURE__*/function ()
59
59
  }
60
60
  }
61
61
  }]);
62
- }(); // TODO We should use a scoped ActiveAnchorTracker rather than the global static object.
62
+ }(); // TODO: ED-26959 - We should use a scoped ActiveAnchorTracker rather than the global static object.
63
63
  // Move this into the plugin scope once the newApply functions becomes default apply.
64
64
  var defaultActiveAnchorTracker = exports.defaultActiveAnchorTracker = new ActiveAnchorTracker();
65
65
  var useActiveAnchorTracker = exports.useActiveAnchorTracker = function useActiveAnchorTracker(anchorName) {
@@ -59,7 +59,8 @@ var getSelection = exports.getSelection = function getSelection(tr, start) {
59
59
  var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
60
60
  var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
61
61
  var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
62
- if (isNodeSelection && nodeName !== 'blockquote' || ((0, _platformFeatureFlags.fg)('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
62
+ var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
63
+ if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension && (0, _platformFeatureFlags.fg)('platform_editor_non_macros_copy_and_paste_fix') || ((0, _platformFeatureFlags.fg)('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
63
64
  // decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
64
65
  ['decisionList', 'layoutColumn'].includes(nodeName || '')) {
65
66
  return new _state.NodeSelection($startPos);
@@ -236,7 +236,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
236
236
  view.focus();
237
237
  }, [isMultiSelect, api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions, api === null || api === void 0 ? void 0 : api.blockControls.sharedState, api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
238
238
 
239
- // TODO - This needs to be investigated further. Drag preview generation is not always working
239
+ // TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
240
240
  // as expected with a node selection. This workaround sets the selection to the node on mouseDown,
241
241
  // but ensures the preview is generated correctly.
242
242
  var handleMouseDown = (0, _react.useCallback)(function () {
@@ -50,7 +50,7 @@ var containerStaticStyles = (0, _primitives.xcss)({
50
50
  zIndex: 'card'
51
51
  });
52
52
 
53
- // TODO: Share prop types between DragHandle - generic enough to create a type for block control decoration
53
+ // TODO: ED-26959 - Share prop types between DragHandle - generic enough to create a type for block control decoration
54
54
 
55
55
  var isSelectionInNode = function isSelectionInNode(start, view) {
56
56
  var node = view.state.doc.nodeAt(start);
@@ -381,7 +381,7 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
381
381
  const destParent = $to.node($to.depth);
382
382
  const sourceNode = $handlePos.nodeAfter;
383
383
 
384
- //TODO: Does this need to be updated with new selection logic above? ^
384
+ //TODO: ED-26959 - Does this need to be updated with new selection logic above? ^
385
385
  // Move a layout column to top level
386
386
  if (sourceNode && isDragLayoutColumnToTopLevel($handlePos, $to)) {
387
387
  // need update after we support single column layout.
@@ -207,7 +207,7 @@ const canMoveToLayout = (api, from, to, tr, moveNodeAtCursorPos) => {
207
207
  sourceTo = Math.max(anchor, head);
208
208
  sourceContent = tr.doc.slice(sourceFrom, sourceTo).content;
209
209
 
210
- // TODO: this might become expensive for large content, consider removing it if check has been done beforehand
210
+ // TODO: ED-26959 - this might become expensive for large content, consider removing it if check has been done beforehand
211
211
  if (containsNodeOfType(sourceContent, 'layoutSection')) {
212
212
  return;
213
213
  }
@@ -277,7 +277,7 @@ const getBreakoutMode = (content, breakout) => {
277
277
  }
278
278
  };
279
279
 
280
- // TODO: As part of platform_editor_element_drag_and_drop_multiselect clean up,
280
+ // TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
281
281
  // source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
282
282
  export const moveToLayout = api => (from, to, options) => ({
283
283
  tr
@@ -62,7 +62,7 @@ export const handleMouseOver = (view, event, api) => {
62
62
  }
63
63
 
64
64
  // We want to exlude handles from showing for wrapped nodes
65
- // TODO We should be able remove these check if we decided to
65
+ // TODO: ED-26959 - We should be able remove these check if we decided to
66
66
  // go we not decoration for wrapped image solution.
67
67
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '')) {
68
68
  return false;
@@ -615,7 +615,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
615
615
  return false;
616
616
  }
617
617
 
618
- // TODO: Review usage of posAtDOM here
618
+ // TODO: ED-26959 - Review usage of posAtDOM here
619
619
  const domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
620
620
  const nodeTarget = state.doc.nodeAt(domPos);
621
621
  const isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
@@ -39,7 +39,7 @@ export class ActiveAnchorTracker {
39
39
  }
40
40
  }
41
41
 
42
- // TODO We should use a scoped ActiveAnchorTracker rather than the global static object.
42
+ // TODO: ED-26959 - We should use a scoped ActiveAnchorTracker rather than the global static object.
43
43
  // Move this into the plugin scope once the newApply functions becomes default apply.
44
44
  export const defaultActiveAnchorTracker = new ActiveAnchorTracker();
45
45
  export const useActiveAnchorTracker = (anchorName, activeAnchorTracker = defaultActiveAnchorTracker) => {
@@ -53,7 +53,8 @@ export const getSelection = (tr, start) => {
53
53
  const nodeName = node === null || node === void 0 ? void 0 : node.type.name;
54
54
  const isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
55
55
  const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
56
- if (isNodeSelection && nodeName !== 'blockquote' || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
56
+ const isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
57
+ if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension && fg('platform_editor_non_macros_copy_and_paste_fix') || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
57
58
  // decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
58
59
  ['decisionList', 'layoutColumn'].includes(nodeName || '')) {
59
60
  return new NodeSelection($startPos);
@@ -217,7 +217,7 @@ export const DragHandle = ({
217
217
  view.focus();
218
218
  }, [isMultiSelect, api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions, api === null || api === void 0 ? void 0 : api.blockControls.sharedState, api === null || api === void 0 ? void 0 : (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
219
219
 
220
- // TODO - This needs to be investigated further. Drag preview generation is not always working
220
+ // TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
221
221
  // as expected with a node selection. This workaround sets the selection to the node on mouseDown,
222
222
  // but ensures the preview is generated correctly.
223
223
  const handleMouseDown = useCallback(() => {
@@ -36,7 +36,7 @@ const extendedHoverZone = () => css({
36
36
  zIndex: -1
37
37
  }
38
38
  },
39
- // TODO - ED-23995 this style override needs to be moved to the Rule styles after FF cleanup - packages/editor/editor-common/src/styles/shared/rule.ts
39
+ // TODO: ED-23995 - this style override needs to be moved to the Rule styles after FF cleanup - packages/editor/editor-common/src/styles/shared/rule.ts
40
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
41
41
  'hr[data-drag-handler-anchor-name]': {
42
42
  overflow: 'visible'
@@ -109,7 +109,7 @@ const extendedHoverZoneNested = () => css({
109
109
  zIndex: 1
110
110
  }
111
111
  },
112
- // TODO - ED-23995 this style override needs to be moved to the Rule styles after FF cleanup - packages/editor/editor-common/src/styles/shared/rule.ts
112
+ // TODO: ED-23995 - this style override needs to be moved to the Rule styles after FF cleanup packages/editor/editor-common/src/styles/shared/rule.ts
113
113
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
114
114
  'hr[data-drag-handler-anchor-name]': {
115
115
  overflow: 'visible'
@@ -39,7 +39,7 @@ const containerStaticStyles = xcss({
39
39
  zIndex: 'card'
40
40
  });
41
41
 
42
- // TODO: Share prop types between DragHandle - generic enough to create a type for block control decoration
42
+ // TODO: ED-26959 - Share prop types between DragHandle - generic enough to create a type for block control decoration
43
43
 
44
44
  const isSelectionInNode = (start, view) => {
45
45
  const node = view.state.doc.nodeAt(start);
@@ -373,7 +373,7 @@ export var moveNode = function moveNode(api) {
373
373
  var destParent = $to.node($to.depth);
374
374
  var sourceNode = $handlePos.nodeAfter;
375
375
 
376
- //TODO: Does this need to be updated with new selection logic above? ^
376
+ //TODO: ED-26959 - Does this need to be updated with new selection logic above? ^
377
377
  // Move a layout column to top level
378
378
  if (sourceNode && isDragLayoutColumnToTopLevel($handlePos, $to)) {
379
379
  // need update after we support single column layout.
@@ -201,7 +201,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
201
201
  sourceTo = Math.max(anchor, head);
202
202
  sourceContent = tr.doc.slice(sourceFrom, sourceTo).content;
203
203
 
204
- // TODO: this might become expensive for large content, consider removing it if check has been done beforehand
204
+ // TODO: ED-26959 - this might become expensive for large content, consider removing it if check has been done beforehand
205
205
  if (containsNodeOfType(sourceContent, 'layoutSection')) {
206
206
  return;
207
207
  }
@@ -280,7 +280,7 @@ var getBreakoutMode = function getBreakoutMode(content, breakout) {
280
280
  }
281
281
  };
282
282
 
283
- // TODO: As part of platform_editor_element_drag_and_drop_multiselect clean up,
283
+ // TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
284
284
  // source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
285
285
  export var moveToLayout = function moveToLayout(api) {
286
286
  return function (from, to, options) {
@@ -61,7 +61,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
61
61
  }
62
62
 
63
63
  // We want to exlude handles from showing for wrapped nodes
64
- // TODO We should be able remove these check if we decided to
64
+ // TODO: ED-26959 - We should be able remove these check if we decided to
65
65
  // go we not decoration for wrapped image solution.
66
66
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '')) {
67
67
  return false;
@@ -626,7 +626,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
626
626
  return false;
627
627
  }
628
628
 
629
- // TODO: Review usage of posAtDOM here
629
+ // TODO: ED-26959 - Review usage of posAtDOM here
630
630
  var domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
631
631
  var nodeTarget = state.doc.nodeAt(domPos);
632
632
  var isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
@@ -54,7 +54,7 @@ export var ActiveAnchorTracker = /*#__PURE__*/function () {
54
54
  }]);
55
55
  }();
56
56
 
57
- // TODO We should use a scoped ActiveAnchorTracker rather than the global static object.
57
+ // TODO: ED-26959 - We should use a scoped ActiveAnchorTracker rather than the global static object.
58
58
  // Move this into the plugin scope once the newApply functions becomes default apply.
59
59
  export var defaultActiveAnchorTracker = new ActiveAnchorTracker();
60
60
  export var useActiveAnchorTracker = function useActiveAnchorTracker(anchorName) {
@@ -53,7 +53,8 @@ export var getSelection = function getSelection(tr, start) {
53
53
  var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
54
54
  var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
55
55
  var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
56
- if (isNodeSelection && nodeName !== 'blockquote' || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
56
+ var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
57
+ if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension && fg('platform_editor_non_macros_copy_and_paste_fix') || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
57
58
  // decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
58
59
  ['decisionList', 'layoutColumn'].includes(nodeName || '')) {
59
60
  return new NodeSelection($startPos);
@@ -231,7 +231,7 @@ export var DragHandle = function DragHandle(_ref) {
231
231
  view.focus();
232
232
  }, [isMultiSelect, api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions, api === null || api === void 0 ? void 0 : api.blockControls.sharedState, api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
233
233
 
234
- // TODO - This needs to be investigated further. Drag preview generation is not always working
234
+ // TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
235
235
  // as expected with a node selection. This workaround sets the selection to the node on mouseDown,
236
236
  // but ensures the preview is generated correctly.
237
237
  var handleMouseDown = useCallback(function () {
@@ -40,7 +40,7 @@ var containerStaticStyles = xcss({
40
40
  zIndex: 'card'
41
41
  });
42
42
 
43
- // TODO: Share prop types between DragHandle - generic enough to create a type for block control decoration
43
+ // TODO: ED-26959 - Share prop types between DragHandle - generic enough to create a type for block control decoration
44
44
 
45
45
  var isSelectionInNode = function isSelectionInNode(start, view) {
46
46
  var node = view.state.doc.nodeAt(start);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "3.3.5",
3
+ "version": "3.3.6",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^102.0.0",
36
+ "@atlaskit/editor-common": "^102.3.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.3.0",
41
41
  "@atlaskit/editor-plugin-metrics": "^3.4.0",
42
- "@atlaskit/editor-plugin-quick-insert": "^2.0.0",
43
- "@atlaskit/editor-plugin-selection": "^2.0.0",
42
+ "@atlaskit/editor-plugin-quick-insert": "^2.1.0",
43
+ "@atlaskit/editor-plugin-selection": "^2.1.0",
44
44
  "@atlaskit/editor-plugin-width": "^3.0.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
46
  "@atlaskit/editor-shared-styles": "^3.4.0",
@@ -49,10 +49,10 @@
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
52
- "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^2.1.0",
52
+ "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^2.2.0",
53
53
  "@atlaskit/primitives": "^14.1.0",
54
54
  "@atlaskit/theme": "^18.0.0",
55
- "@atlaskit/tmp-editor-statsig": "^3.4.0",
55
+ "@atlaskit/tmp-editor-statsig": "^3.5.0",
56
56
  "@atlaskit/tokens": "^4.3.0",
57
57
  "@atlaskit/tooltip": "^20.0.0",
58
58
  "@babel/runtime": "^7.0.0",