@atlaskit/editor-plugin-block-controls 7.7.7 → 7.7.9

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,22 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 7.7.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ae4f9cd8ff5f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ae4f9cd8ff5f7) -
8
+ [ux] [EDITOR-2757] Remove breakout mark when drag and drop node in bodiedSyncBlock
9
+ - Updated dependencies
10
+
11
+ ## 7.7.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [`0d237a5696b06`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d237a5696b06) -
16
+ Uncoupled several block of changes from the aifc FG and moved them behind their own FG so they can
17
+ be rolled out quicker
18
+ - Updated dependencies
19
+
3
20
  ## 7.7.7
4
21
 
5
22
  ### Patch Changes
@@ -18,6 +18,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
18
18
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
19
19
  var _utils3 = require("@atlaskit/editor-tables/utils");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
22
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
22
23
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
24
  var _main = require("../pm-plugins/main");
@@ -313,7 +314,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
313
314
  var inputMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _analytics.INPUT_METHOD.DRAG_AND_DROP;
314
315
  var formatMessage = arguments.length > 3 ? arguments[3] : undefined;
315
316
  return function (_ref7) {
316
- var _api$blockControls$co, _api$accessibilityUti;
317
+ var _convertedNodeSlice, _api$blockControls$co, _api$accessibilityUti;
317
318
  var tr = _ref7.tr;
318
319
  if (!api || start < 0 || to < 0) {
319
320
  return tr;
@@ -350,7 +351,8 @@ var moveNode = exports.moveNode = function moveNode(api) {
350
351
  var $to = tr.doc.resolve(to);
351
352
  var $handlePos = tr.doc.resolve(start);
352
353
  var nodeCopy = tr.doc.slice(sliceFrom, sliceTo, false); // cut the content
353
- var destType = $to.node().type;
354
+ var destNode = $to.node();
355
+ var destType = destNode.type;
354
356
  var destParent = $to.node($to.depth);
355
357
  var sourceNode = $handlePos.nodeAfter;
356
358
 
@@ -379,7 +381,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
379
381
  return tr;
380
382
  }
381
383
  var convertedNodeSlice = transformSourceSlice(nodeCopy, destType);
382
- var convertedNode = convertedNodeSlice === null || convertedNodeSlice === void 0 ? void 0 : convertedNodeSlice.content;
384
+ var convertedNode = (_convertedNodeSlice = convertedNodeSlice) === null || _convertedNodeSlice === void 0 ? void 0 : _convertedNodeSlice.content;
383
385
  if (!convertedNode) {
384
386
  return tr;
385
387
  }
@@ -387,6 +389,20 @@ var moveNode = exports.moveNode = function moveNode(api) {
387
389
  sliceFrom = sliceFrom - 1;
388
390
  }
389
391
 
392
+ // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
393
+ // Hence strip out the mark for now
394
+ if (destNode.type.name === 'bodiedSyncBlock' && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
395
+ var _convertedNodeSlice2;
396
+ var nodes = [];
397
+ (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 || _convertedNodeSlice2.content.forEach(function (node) {
398
+ nodes.push(node.mark(node.marks.filter(function (mark) {
399
+ return mark.type.name !== 'breakout';
400
+ })));
401
+ });
402
+ convertedNodeSlice = new _model.Slice(_model.Fragment.from(nodes), 0, 0);
403
+ convertedNode = convertedNodeSlice.content;
404
+ }
405
+
390
406
  // delete the content from the original position
391
407
  tr.delete(sliceFrom, sliceTo);
392
408
  var mappedTo = tr.mapping.map(to);
@@ -57,7 +57,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
57
57
  var toolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
58
58
 
59
59
  // We shouldn't be firing mouse over transactions when the editor is disabled
60
- if (editorDisabled && (0, _platformFeatureFlags.fg)('aifc_create_enabled')) {
60
+ if (editorDisabled && (0, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc')) {
61
61
  return false;
62
62
  }
63
63
 
@@ -5,11 +5,12 @@ import { expandSelectionBounds, GapCursorSelection } from '@atlaskit/editor-comm
5
5
  import { transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
6
6
  import { DIRECTION } from '@atlaskit/editor-common/types';
7
7
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
8
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
8
+ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
9
9
  import { Selection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
11
11
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
14
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
16
  import { key } from '../pm-plugins/main';
@@ -315,7 +316,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
315
316
  export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_DROP, formatMessage) => ({
316
317
  tr
317
318
  }) => {
318
- var _api$blockControls$co2, _api$accessibilityUti;
319
+ var _convertedNodeSlice, _api$blockControls$co2, _api$accessibilityUti;
319
320
  if (!api || start < 0 || to < 0) {
320
321
  return tr;
321
322
  }
@@ -352,7 +353,8 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
352
353
  const $to = tr.doc.resolve(to);
353
354
  const $handlePos = tr.doc.resolve(start);
354
355
  const nodeCopy = tr.doc.slice(sliceFrom, sliceTo, false); // cut the content
355
- const destType = $to.node().type;
356
+ const destNode = $to.node();
357
+ const destType = destNode.type;
356
358
  const destParent = $to.node($to.depth);
357
359
  const sourceNode = $handlePos.nodeAfter;
358
360
 
@@ -380,8 +382,8 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
380
382
  if (!canMoveNodeToIndex(destParent, $to.index(), $handlePos.node().child($handlePos.index()), $to)) {
381
383
  return tr;
382
384
  }
383
- const convertedNodeSlice = transformSourceSlice(nodeCopy, destType);
384
- const convertedNode = convertedNodeSlice === null || convertedNodeSlice === void 0 ? void 0 : convertedNodeSlice.content;
385
+ let convertedNodeSlice = transformSourceSlice(nodeCopy, destType);
386
+ let convertedNode = (_convertedNodeSlice = convertedNodeSlice) === null || _convertedNodeSlice === void 0 ? void 0 : _convertedNodeSlice.content;
385
387
  if (!convertedNode) {
386
388
  return tr;
387
389
  }
@@ -389,6 +391,18 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
389
391
  sliceFrom = sliceFrom - 1;
390
392
  }
391
393
 
394
+ // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
395
+ // Hence strip out the mark for now
396
+ if (destNode.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true)) {
397
+ var _convertedNodeSlice2;
398
+ const nodes = [];
399
+ (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 ? void 0 : _convertedNodeSlice2.content.forEach(node => {
400
+ nodes.push(node.mark(node.marks.filter(mark => mark.type.name !== 'breakout')));
401
+ });
402
+ convertedNodeSlice = new Slice(Fragment.from(nodes), 0, 0);
403
+ convertedNode = convertedNodeSlice.content;
404
+ }
405
+
392
406
  // delete the content from the original position
393
407
  tr.delete(sliceFrom, sliceTo);
394
408
  const mappedTo = tr.mapping.map(to);
@@ -49,7 +49,7 @@ export const handleMouseOver = (view, event, api) => {
49
49
  const toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
50
50
 
51
51
  // We shouldn't be firing mouse over transactions when the editor is disabled
52
- if (editorDisabled && fg('aifc_create_enabled')) {
52
+ if (editorDisabled && fg('platform_editor_ai_generic_prep_for_aifc')) {
53
53
  return false;
54
54
  }
55
55
 
@@ -8,11 +8,12 @@ import { expandSelectionBounds, GapCursorSelection } from '@atlaskit/editor-comm
8
8
  import { transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
9
9
  import { DIRECTION } from '@atlaskit/editor-common/types';
10
10
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
11
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
11
+ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
12
  import { Selection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
14
14
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
17
18
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
19
  import { key } from '../pm-plugins/main';
@@ -307,7 +308,7 @@ export var moveNode = function moveNode(api) {
307
308
  var inputMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : INPUT_METHOD.DRAG_AND_DROP;
308
309
  var formatMessage = arguments.length > 3 ? arguments[3] : undefined;
309
310
  return function (_ref7) {
310
- var _api$blockControls$co, _api$accessibilityUti;
311
+ var _convertedNodeSlice, _api$blockControls$co, _api$accessibilityUti;
311
312
  var tr = _ref7.tr;
312
313
  if (!api || start < 0 || to < 0) {
313
314
  return tr;
@@ -344,7 +345,8 @@ export var moveNode = function moveNode(api) {
344
345
  var $to = tr.doc.resolve(to);
345
346
  var $handlePos = tr.doc.resolve(start);
346
347
  var nodeCopy = tr.doc.slice(sliceFrom, sliceTo, false); // cut the content
347
- var destType = $to.node().type;
348
+ var destNode = $to.node();
349
+ var destType = destNode.type;
348
350
  var destParent = $to.node($to.depth);
349
351
  var sourceNode = $handlePos.nodeAfter;
350
352
 
@@ -373,7 +375,7 @@ export var moveNode = function moveNode(api) {
373
375
  return tr;
374
376
  }
375
377
  var convertedNodeSlice = transformSourceSlice(nodeCopy, destType);
376
- var convertedNode = convertedNodeSlice === null || convertedNodeSlice === void 0 ? void 0 : convertedNodeSlice.content;
378
+ var convertedNode = (_convertedNodeSlice = convertedNodeSlice) === null || _convertedNodeSlice === void 0 ? void 0 : _convertedNodeSlice.content;
377
379
  if (!convertedNode) {
378
380
  return tr;
379
381
  }
@@ -381,6 +383,20 @@ export var moveNode = function moveNode(api) {
381
383
  sliceFrom = sliceFrom - 1;
382
384
  }
383
385
 
386
+ // Currently we don't support breakout mark for children nodes of bodiedSyncBlock node
387
+ // Hence strip out the mark for now
388
+ if (destNode.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true)) {
389
+ var _convertedNodeSlice2;
390
+ var nodes = [];
391
+ (_convertedNodeSlice2 = convertedNodeSlice) === null || _convertedNodeSlice2 === void 0 || _convertedNodeSlice2.content.forEach(function (node) {
392
+ nodes.push(node.mark(node.marks.filter(function (mark) {
393
+ return mark.type.name !== 'breakout';
394
+ })));
395
+ });
396
+ convertedNodeSlice = new Slice(Fragment.from(nodes), 0, 0);
397
+ convertedNode = convertedNodeSlice.content;
398
+ }
399
+
384
400
  // delete the content from the original position
385
401
  tr.delete(sliceFrom, sliceTo);
386
402
  var mappedTo = tr.mapping.map(to);
@@ -50,7 +50,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
50
50
  var toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
51
51
 
52
52
  // We shouldn't be firing mouse over transactions when the editor is disabled
53
- if (editorDisabled && fg('aifc_create_enabled')) {
53
+ if (editorDisabled && fg('platform_editor_ai_generic_prep_for_aifc')) {
54
54
  return false;
55
55
  }
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.7.7",
3
+ "version": "7.7.9",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -52,10 +52,10 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
55
- "@atlaskit/primitives": "^16.2.0",
55
+ "@atlaskit/primitives": "^16.3.0",
56
56
  "@atlaskit/theme": "^21.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^13.41.0",
58
- "@atlaskit/tokens": "^8.2.0",
57
+ "@atlaskit/tmp-editor-statsig": "^13.42.0",
58
+ "@atlaskit/tokens": "^8.3.0",
59
59
  "@atlaskit/tooltip": "^20.10.0",
60
60
  "@babel/runtime": "^7.0.0",
61
61
  "@emotion/react": "^11.7.1",
@@ -66,7 +66,7 @@
66
66
  "uuid": "^3.1.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@atlaskit/editor-common": "^110.33.0",
69
+ "@atlaskit/editor-common": "^110.34.0",
70
70
  "react": "^18.2.0",
71
71
  "react-dom": "^18.2.0",
72
72
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -137,7 +137,7 @@
137
137
  "platform_editor_fix_widget_destroy": {
138
138
  "type": "boolean"
139
139
  },
140
- "aifc_create_enabled": {
140
+ "platform_editor_ai_generic_prep_for_aifc": {
141
141
  "type": "boolean"
142
142
  },
143
143
  "dst-a11y__replace-anchor-with-link__editor-jenga": {