@atlaskit/editor-plugin-block-controls 32.0.1 → 33.0.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,13 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 33.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b2444e74978c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2444e74978c4) -
8
+ Make the shipped editor memory-leak reductions permanent and remove the experiment checks.
9
+ - Updated dependencies
10
+
3
11
  ## 32.0.1
4
12
 
5
13
  ### Patch Changes
@@ -9,14 +9,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = require("react");
10
10
  var _uuid = require("uuid");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
13
12
  var _consts = require("../ui/consts");
14
13
  var _dragHandle = require("../ui/drag-handle");
15
14
  var _decorationsCommon = require("./decorations-common");
16
15
  var _reactRootRegistry = require("./react-root-registry");
17
16
  var _marks = require("./utils/marks");
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
17
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
18
+
20
19
  var TYPE_ACTIVE_HANDLE_DEC = exports.TYPE_ACTIVE_HANDLE_DEC = 'active-drag-handle-node';
21
20
 
22
21
  /**
@@ -69,7 +68,7 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
69
68
  (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
70
69
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
71
70
  var key = (0, _uuid.v4)();
72
- var widgetSpec = _objectSpread({
71
+ var widgetSpec = {
73
72
  side: -1,
74
73
  type: _decorationsCommon.TYPE_HANDLE_DEC,
75
74
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
@@ -79,15 +78,14 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
79
78
  * Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
80
79
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
81
80
  */
82
- marks: (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
83
- }, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks') && {
81
+ marks: (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
84
82
  destroy: function destroy(node) {
85
83
  // Deferred: unmounting a root during a React render warns
86
84
  queueMicrotask(function () {
87
85
  return unmountUnlessMenuOpen(api, node);
88
86
  });
89
87
  }
90
- });
88
+ };
91
89
  return _view.Decoration.widget(pos, function (view, getPosUnsafe) {
92
90
  var element = document.createElement('span');
93
91
  // inline decoration causes focus issues when refocusing Editor into first line
@@ -2,7 +2,6 @@ import { createElement } from 'react';
2
2
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
3
3
  import { v4 as uuid } from 'uuid';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
5
  import { ACTIVE_DRAG_HANDLE_ATTR } from '../ui/consts';
7
6
  import { DragHandleWithVisibility } from '../ui/drag-handle';
8
7
  import { TYPE_HANDLE_DEC, TYPE_NODE_DEC, unmountDecorations } from './decorations-common';
@@ -67,12 +66,10 @@ export const dragHandleDecoration = ({
67
66
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
68
67
  */
69
68
  marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
70
- ...(isExperimentEnabled('platform_editor_reduce_memory_leaks') && {
71
- destroy: node => {
72
- // Deferred: unmounting a root during a React render warns
73
- queueMicrotask(() => unmountUnlessMenuOpen(api, node));
74
- }
75
- })
69
+ destroy: node => {
70
+ // Deferred: unmounting a root during a React render warns
71
+ queueMicrotask(() => unmountUnlessMenuOpen(api, node));
72
+ }
76
73
  };
77
74
  return Decoration.widget(pos, (view, getPosUnsafe) => {
78
75
  const element = document.createElement('span');
@@ -1,11 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
2
  import { createElement } from 'react';
5
3
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
6
4
  import { v4 as uuid } from 'uuid';
7
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
8
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
9
6
  import { ACTIVE_DRAG_HANDLE_ATTR } from '../ui/consts';
10
7
  import { DragHandleWithVisibility } from '../ui/drag-handle';
11
8
  import { TYPE_HANDLE_DEC, TYPE_NODE_DEC, unmountDecorations } from './decorations-common';
@@ -63,7 +60,7 @@ export var dragHandleDecoration = function dragHandleDecoration(_ref) {
63
60
  unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
64
61
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
65
62
  var key = uuid();
66
- var widgetSpec = _objectSpread({
63
+ var widgetSpec = {
67
64
  side: -1,
68
65
  type: TYPE_HANDLE_DEC,
69
66
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
@@ -73,15 +70,14 @@ export var dragHandleDecoration = function dragHandleDecoration(_ref) {
73
70
  * Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
74
71
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
75
72
  */
76
- marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
77
- }, isExperimentEnabled('platform_editor_reduce_memory_leaks') && {
73
+ marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
78
74
  destroy: function destroy(node) {
79
75
  // Deferred: unmounting a root during a React render warns
80
76
  queueMicrotask(function () {
81
77
  return unmountUnlessMenuOpen(api, node);
82
78
  });
83
79
  }
84
- });
80
+ };
85
81
  return Decoration.widget(pos, function (view, getPosUnsafe) {
86
82
  var element = document.createElement('span');
87
83
  // inline decoration causes focus issues when refocusing Editor into first line
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "32.0.1",
3
+ "version": "33.0.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,25 +29,25 @@
29
29
  "@atlaskit/button": "^25.8.0",
30
30
  "@atlaskit/css": "^1.1.0",
31
31
  "@atlaskit/docs": "^12.3.0",
32
- "@atlaskit/editor-plugin-accessibility-utils": "^31.0.0",
33
- "@atlaskit/editor-plugin-analytics": "^31.0.0",
34
- "@atlaskit/editor-plugin-block-collapse": "^17.0.0",
35
- "@atlaskit/editor-plugin-editor-disabled": "^31.0.0",
36
- "@atlaskit/editor-plugin-editor-viewmode": "^33.0.0",
37
- "@atlaskit/editor-plugin-feature-flags": "^30.0.0",
38
- "@atlaskit/editor-plugin-interaction": "^45.0.0",
39
- "@atlaskit/editor-plugin-limited-mode": "^28.0.0",
40
- "@atlaskit/editor-plugin-metrics": "^32.0.0",
41
- "@atlaskit/editor-plugin-quick-insert": "^31.0.0",
42
- "@atlaskit/editor-plugin-selection": "^31.1.0",
43
- "@atlaskit/editor-plugin-show-diff": "^31.0.0",
44
- "@atlaskit/editor-plugin-toolbar": "^28.0.0",
45
- "@atlaskit/editor-plugin-type-ahead": "^32.1.0",
46
- "@atlaskit/editor-plugin-ui-control-registry": "^25.0.0",
47
- "@atlaskit/editor-plugin-user-intent": "^29.0.0",
48
- "@atlaskit/editor-plugin-width": "^32.0.0",
32
+ "@atlaskit/editor-plugin-accessibility-utils": "^32.0.0",
33
+ "@atlaskit/editor-plugin-analytics": "^32.0.0",
34
+ "@atlaskit/editor-plugin-block-collapse": "^18.0.0",
35
+ "@atlaskit/editor-plugin-editor-disabled": "^32.0.0",
36
+ "@atlaskit/editor-plugin-editor-viewmode": "^34.0.0",
37
+ "@atlaskit/editor-plugin-feature-flags": "^31.0.0",
38
+ "@atlaskit/editor-plugin-interaction": "^46.0.0",
39
+ "@atlaskit/editor-plugin-limited-mode": "^29.0.0",
40
+ "@atlaskit/editor-plugin-metrics": "^33.0.0",
41
+ "@atlaskit/editor-plugin-quick-insert": "^32.0.0",
42
+ "@atlaskit/editor-plugin-selection": "^32.0.0",
43
+ "@atlaskit/editor-plugin-show-diff": "^32.0.0",
44
+ "@atlaskit/editor-plugin-toolbar": "^29.0.0",
45
+ "@atlaskit/editor-plugin-type-ahead": "^33.0.0",
46
+ "@atlaskit/editor-plugin-ui-control-registry": "^26.0.0",
47
+ "@atlaskit/editor-plugin-user-intent": "^30.0.0",
48
+ "@atlaskit/editor-plugin-width": "^33.0.0",
49
49
  "@atlaskit/editor-prosemirror": "^9.0.0",
50
- "@atlaskit/editor-shared-styles": "^5.1.0",
50
+ "@atlaskit/editor-shared-styles": "^5.2.0",
51
51
  "@atlaskit/editor-tables": "^3.2.0",
52
52
  "@atlaskit/editor-ui-control-model": "^3.0.0",
53
53
  "@atlaskit/icon": "^38.1.0",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^11.1.1"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^135.3.0",
75
+ "@atlaskit/editor-common": "^136.0.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -96,7 +96,7 @@
96
96
  }
97
97
  },
98
98
  "devDependencies": {
99
- "@atlaskit/editor-common": "^135.3.0",
99
+ "@atlaskit/editor-common": "^136.0.0",
100
100
  "@atlassian/structured-docs-types": "workspace:^",
101
101
  "@atlassian/workbench": "workspace:*",
102
102
  "react": "^19.2.0",